Facebook — save user access token
Overview
Validate a Facebook user access token via the Graph API debug endpoint and, if valid, persists the FB user details for the company. Used before selecting a page to connect.
Prerequisites
- Either a bearer token in the
Authorizationheader, or the invitehashthis endpoint accepts in place of one.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/facebook/access-token/save
Authentication
-
A bearer token is optional here. Send one to act as a signed-in user, or supply the documented
hashinstead. -
Use a bearer token (scoped by an ownership check on
company_id). -
OR use an invite
hash(no token;company_idis then omitted).
Rate limit
- 30 requests/min per IP (public).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
user_access_token | string | Required | FB user access token to validate + persist. |
company_id | integer | Required (non-hash) | Must exist + in caller scope (an ownership check). Omitted in the hash flow. |
hash | string | Optional | Invite hash [store_id, 15]; grants access without a token. |
{
"user_access_token": "EAABsbCS...userToken",
"company_id": "<accountId>"
}How it works
- 200 with a positional message. The payload uses an unusual shape:
statusplus a numeric-0message key —{data:{status:"success","0":"User token has been saved successfully!"}}.
Response
200 OK · 200
200{
"data": {
"status": "success",
"0": "User token has been saved successfully!"
}
}200 Invalid token (empty body) · 200
200When the token fails Facebook's validation, the API records the failure and returns an empty 200 response — no JSON body. Treat an empty body as "token rejected".
200 Save failed · 200
200{
"data": {
"status": "error",
"0": "Something went wrong!"
}
}422 Validation error · 422
422{
"message": "The user access token field is required.",
"errors": {
"user_access_token": [
"The user access token field is required."
]
}
}Errors
| Status | Meaning |
|---|---|
401 | The bearer token is missing, expired or invalid |
422 | Validation error |
500 | Unexpected server error |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/facebook/access-token/save" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"user_access_token": "EAABsbCS...userToken", "company_id": "<accountId>"}'Updated 9 days ago
Did this page help you?
