Request access token
Return an OAuth 2.0 bearer token for an API service account.
Tokens are issued using the client credentials grant, which authenticates your service account rather than an individual user.
Exchange your Base64-encoded service account credentials for an OAuth2 access token.
Enter Basic, a space, and your Base64-encoded ClientID:ClientSecret (the only value you need to edit).
Basic <Base64Encoded(ClientID:ClientSecret)>The OAuth2 grant type. Always client_credentials, because your service account authenticates as itself rather than on behalf of a user.
The scope of the access token. Always api/api.
An access token was issued.
The bearer token to send on every API request.
The type of token issued.
BearerThe lifetime of the token in seconds. Tokens are issued with a lifetime of one hour.
3600The request was rejected. invalid_client means the credentials in the Authorization header were not accepted.
POST /oauth2/token HTTP/1.1
Host: eseye-idp-prod.auth.eu-west-1.amazoncognito.com
Authorization: Basic <Base64Encoded(ClientID:ClientSecret)>
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 53
"grant_type='client_credentials'&scope='api/api'"{
"access_token": "eyJraWQiOiJhYmMxMjMiLCJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer",
"expires_in": 3600
}Returns an OAuth 2.0 bearer token for an API service account.
POST /oauth2/tokenEndpoint
Replace <region> with the AWS region Eseye provided.
Request headers
Authorization
Basic <credentials>
Yes
Content-Type
application/x-www-form-urlencoded
Yes
<credentials> is the Base64-encoded form of <client-id>:<client-secret>.
Form parameters
grant_type
client_credentials
Yes
Authenticates the service account.
scope
api/api
Yes
Requests Eseye API access.
Example request
Successful response
An accepted request returns HTTP 200:
Reuse the token until it expires, then request another token.
Error response
The endpoint returns HTTP 400 when it rejects a request. An invalid_client error means the credentials were not accepted.
Last updated
Was this helpful?