Brand2Social API Documentation

Comprehensive guide to Brand2Social API endpoints

Connect Social Account

Generate an OAuth URL to connect a social media account for a brand. Redirect the user to this URL to authenticate and link the account. For Twitter, you must first call twitter-oauth-credentials to upsert organization-level OAuth credentials. The resulting connected_profile_id can be used in create-new-post or update-new-post. Supported platforms: Facebook, Instagram, YouTube, LinkedIn, Google My Business, Twitter.

  • Method: POST
  • Endpoint: /api/api-services/v1/brand-service/social-connect
  • Returns: OAuth URL for redirecting the user to connect the social account

Connect Social Account

POST https://app.brand2social.com/api/api-services/v1/brand-service/social-connect

FieldTypeRequiredDescription
Authorizationstring (header)YesBearer token for authentication
brand_idint64YesID of the brand
redirect_urlstringYesURL to redirect the user after authentication
platformstringYesSocial media platform: FACEBOOK, INSTAGRAM, YOUTUBE, LINKEDIN, GOOGLEMYBUSINESS, TWITTER
curl --location 'https://app.brand2social.com/api/api-services/v1/brand-service/social-connect' \
    --header 'Authorization: Bearer B2S_dummyToken' \
    --data-raw '{
      "brand_id": "cust_123",
      "redirect_url": "https:/sample.com/redirect-url",
      "platform": "FACEBOOK",
    }'

Response

{
  "status": "SUCCESS",
  "http_code": 200,
  "message": "SUCCESS",
  "data": [
    {
      "url": "https://www.facebook.com/v17.0/dialog/oauth?client_id=xxxxxx&redirect_uri=xxxxx&scope=xxxx&state=xxxxx",
    }
  ]
}
    
    
curl --location 'https://app.brand2social.com/api/api-services/v1/brand-service/social-connect' \
  --header 'Authorization: Bearer B2S_dummyToken' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "brand_id": 123,
    "redirect_url": "https://example.com/redirect-url",
    "platform": "TWITTER"
}'
    
  

Response

{
  "status": "SUCCESS",
  "http_code": 200,
  "message": "SUCCESS",
  "data": {
    "url": "https://api.twitter.com/oauth/authorize?oauth_token=xxxxxx"
  }
}

Error Response

{
  "status": "FAILURE",
  "http_code": 400,
  "message": "Twitter OAuth credentials not found for organization",
  "data": ""
}