Skip to navigation

Exchange client credentials for an access token

OAuth2 client-credentials token endpoint. Authenticate with HTTP Basic (client_id:client_secret) or put both values in the form body, and request the westiq/search scope. The returned bearer access token authorizes every /v1/* request until it expires (about an hour) — cache and reuse it rather than requesting one per call. Note the host: token requests go to the authorization endpoint below, not to the API base URL.

Request

This endpoint expects an object.
grant_typeenumRequired

Always client_credentials.

Allowed values:
scopestringOptional

Request westiq/search — the one scope every /v1 endpoint requires.

client_idstringOptional

Your client id — here in the body, or via HTTP Basic auth.

client_secretstringOptional

Your client secret — here in the body, or via HTTP Basic auth.

Response

Token issued.
access_tokenstring

The bearer access token for Authorization: Bearer <token>.

token_typestring

Always Bearer.

expires_ininteger

Token lifetime in seconds (about 3600).

Errors

400
Bad Request Error
401
Unauthorized Error