Brand2Social API Documentation

Comprehensive guide to Brand2Social API endpoints

Upsert Twitter OAuth Credentials

Upsert Twitter OAuth credentials (consumer_key, consumer_key_secret) at the organization level. This endpoint must be called before social-connect when connecting a Twitter account. To obtain the consumer_key and consumer_key_secret, add https://app.brand2social.com/custom/twitter-redirect as a callback URL in your Twitter Developer account. Don’t forget to add this redirect URL! Credentials are encrypted and stored for use in generating Twitter OAuth URLs.

  • Method: POST
  • Endpoint: /api/api-services/v1/brand-service/twitter-oauth-credentials
  • Returns: Confirmation of successful credential upsert

Upsert Twitter OAuth Credentials

POST https://app.brand2social.com/api/api-services/v1/brand-service/twitter-oauth-credentials

To obtain the consumer_key and consumer_key_secret, add https://app.brand2social.com/custom/twitter-redirect as a callback URL in your Twitter Developer account. Don’t forget to add this redirect URL!

FieldTypeRequiredDescription
Authorizationstring (header)YesBearer token for authentication (requires ORG_ADMIN permission)
consumer_keystringYesTwitter OAuth consumer key
consumer_key_secretstringYesTwitter OAuth consumer key secret
    
    
curl --location 'https://app.brand2social.com/api/api-services/v1/brand-service/twitter-oauth-credentials' \
  --header 'Authorization: Bearer B2S_dummyToken' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "consumer_key": "xxxxxxxxxxxxxxxxxxxxxxxxx",
    "consumer_key_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}'
    
  

Response

{
  "status": "SUCCESS",
  "http_code": 200,
  "message": "Twitter OAuth credentials added/updated successfully",
  "data": ""
}

Error Response

{
  "status": "FAILURE",
  "http_code": 400,
  "message": "Consumer Key is required",
  "data": ""
}