Skip to content

Create a long lived access token
GA
deprecated

Request

Returns a long lived access token based on the facebook token from the embedded signup. Valid for 60 days.

Security
BasicAuth and BearerAuth and OAuth2Production
Path
projectIdstringrequired

The unique ID of the project. You can find this on the Sinch Dashboard.

Bodyapplication/jsonrequired

Facebook token generated from the embedded signup process, or another long lived access token.

facebookTokenstring, non-empty

Long-Lived User access token. Mandatory if facebookCode is not provided.

facebookCodestring, non-empty

Single-use access code. Mandatory if facebookToken is not provided.

businessManagerstring(WhatsappInputBusinessManagers)

Business manager.

Enum:"SINCH_AMERICA""SINCH_BR""SINCH_MX""SINCH_SEP""SINCH_UK"

Example body request to create a long lived access token.

curl -i -X POST \
  -u '<username>:<password>' \
  'https://provisioning.api.sinch.com/v1/projects/{projectId}/whatsapp/longLivedAccessToken' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "facebookCode": "FACEBOOK_CODE"
  }'

Responses

The long lived access token.

Bodyapplication/json
longLivedAccessTokenstringrequired
Response

Response when successfully creating a long lived access token.

{ "longLivedAccessToken": "FACEBOOK_TOKEN" }
We'd love to hear from you!
Rate this content: