Generate authentication token
Requests to the WhatsApp API are authenticated with a bearer token. There are two kinds of token, and each one only works with its own endpoints:
- Admin token: use it for every endpoint whose path contains
whatsapp-bsp-admin-ext-endpoint-ws. In the examples it is the{{admin-token}}placeholder. - Messaging token: use it for every other endpoint in this documentation, whose path contains
whatsapp-bsp-api-endpoint-ws. In the examples it is the{{wa-msg-api-token}}placeholder.
An admin token doesn't work on messaging endpoints, and a messaging token doesn't work on admin endpoints. Check the endpoint's path to know which one to use.
You generate both tokens with your Api-Key and Api-Token, provided by Concepto Móvil.
{{url}} and {{url_token_admin}} are placeholders for the production hosts. Concepto Móvil gives you their values together with your Api-Key and Api-Token. They are two different hosts: use {{url}} for the Messaging token and {{url_token_admin}} for the Admin token. These values are not public; don't try to infer them.
- Messaging token: valid for 24 hours.
- Admin token: valid for 15 minutes.
If you request a token while the previous one is still valid, the service returns the same token, and its validity still counts from when it was first generated. Once it expires, request a new one.
| Token | Sections that use it |
|---|---|
| Admin |
|
| Messaging |
|
