Skip to Content
Developers

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
FieldTypeDescription
access_tokenstringThe bearer token.
token_typestringAlways Bearer.
expires_inintegerSeconds 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 403 is 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": "..." }:

HTTPerrorWhat to do
400unsupported_grant_typeSend grant_type=client_credentials.
401invalid_clientCheck the client ID and secret.
502temporarily_unavailableRetry after a few seconds.

If a secret leaks, ask WhaPiù to rotate it.

On this page