Authentication

Use API Key credentials to request your authentication token for making StablR API requests.

To securely communicate between your backend servers and StablR via the StablR API, you are required to request an Access Token which is a time-bound token.

API requests with the StablR API:

  • Require authentication for all requests, without it they will fail.
  • Must be made over HTTPS encryption.

Request Access Token

To request an Access Tokens you need to invoke the Request Access Token request.

Request

Replace CLIENT_ID with the Client ID that can be found in the API Management dashboard for the corresponding API Key.

Replace CLIENT_SECRET with the API Key Secret that you have securely stored after creating the respective API Key in your StablR Account.

POST https://stablr-oauth.auth.eu-west-1.amazoncognito.com/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: */*
Cache-Control: no-cache
Host: stablr-oauth.auth.eu-west-1.amazoncognito.com
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
 
grant_type=client_credentials&scope=stablr%2Fadmin&client_id=<CLIENT_ID>&client_secret=<CLIENT_SECRET>

Response

The response looks like this:

{
    "access_token": "ACCESS_TOKEN",
    "expires_in": 300,
    "token_type": "Bearer"
}

📘

API Access Tokens

StablR's Access Tokens for making secure API requests will expire five (5) minutes after creation. This means you have to request a new token after the respective token has expired to keep making valid requests from your backend server.


API Authentication

Authorization: Bearer ACCESS_TOKEN

What’s Next