Authentication
Exchange your client credentials for a bearer token and send it on every call.
POST
/v1/get-tokenReference →
The API uses OAuth 2.0 with the client credentials grant. WhaPiù gives you a client ID and a client secret. You exchange them for a short-lived bearer token, then send that token on every call.
Get a token
POST /v1/get-token accepts a form-encoded or a JSON body. Send the credentials with HTTP Basic authentication or in the body.
curl -X POST "$WAPIU_API/v1/get-token" \
-u "$WAPIU_CLIENT_ID:$WAPIU_CLIENT_SECRET" \
-d grant_type=client_credentials| Field | Type | Description |
|---|---|---|
access_token | string | The bearer token. |
token_type | string | Always Bearer. |
expires_in | integer | Seconds until the token expires. |
{ "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 3600 }Use the token
Authorization: Bearer <access_token>- Reuse the token until it expires.
- If a call answers
401, the token is missing, expired or revoked: request a new one and retry the call once. - A
403is not a token problem: the token is valid but may not act on that number or tenant.
Errors
Token errors follow the OAuth 2.0 format, { "error": "...", "error_description": "..." }:
| HTTP | error | What to do |
|---|---|---|
| 400 | unsupported_grant_type | Send grant_type=client_credentials. |
| 401 | invalid_client | Check the client ID and secret. |
| 502 | temporarily_unavailable | Retry after a few seconds. |
If a secret leaks, ask WhaPiù to rotate it.