Fetch All Accounts for Social Account
After a social account is connected, use this endpoint to fetch all available accounts (pages, profiles, channels) for the selected platform.
Note: This API works only if the social connection was established within the last 1 hour. After 1 hour, the access token will expire, and you will need to reconnect the account.
- Method: POST
- Endpoint:
/api/api-services/v1/brand-service/fetch-all-accounts
- Returns: List of accounts available for the connected brand
Fetch All Accounts
POST https://app.brand2social.com/api/api-services/v1/brand-service/fetch-all-accounts
Header / Body Param | Type | Required | Description |
---|---|---|---|
Authorization | string (header) | Yes | Bearer token |
brand_id | int (body) | Yes | ID of the brand |
platform | string (body) | Yes | Options: [ FACEBOOK, INSTAGRAM, YOUTUBE, LINKEDIN, GOOGLEMYBUSINESS ] |
curl --location 'https://app.brand2social.com/api/api-services/v1/brand-service/fetch-all-accounts' \
--header 'Authorization: Bearer B2S_dummyToken' \
--data-raw '{
"brand_id": "cust_123",
"platform": "FACEBOOK"
}'
Response
{
"status": "SUCCESS",
"http_code": 200,
"message": "Fetched all accounts",
"data": {
"account_id": "xxxxxxxxxx",
"accounts": [
{
"id": "yyyyyyyyyy",
"name": "Sample Name",
"profile_image": "https://image.com/pic.png",
"is_integrated": false
}
],
"next_page": "ttttttttttt"
}
}