Access Tokens

Authentication token for securely accessing Endorsed's API endpoints

Create an Access Token

POST https://endorsed.ai/api/v1/auth/tokens

Creates a new Access Token to be used in subsequent API calls.

Access tokens are short-lived for security reasons. Expiration times are returned in the response; please request another access token before the previous one expires to prevent any downtime in your service.

Headers

Request Body

{
  "is_error": false,
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7ImNsaWVudF9pZCI6IjgwNDJmMjQ0LTc1NDEtNDFkZC05ODcyLTI5YjJmMzBjZDM0NiIsInNjb3BlIjpbImFsbDpyZWFkIiwiYWxsOndyaXRlIl19LCJpYXQiOjE2OTYyODQxNjgsImV4cCI6MzM5MjU3MTkzNn0.TAbNlfr4XszINkAwq5ebKzELuZ9IFBTzTX5tXrbk6EQ",
  "token_type": "Bearer",
  "expires_in": "1209600",
  "scope": ["all:read", "all:write"]
}

Examples:

Using URL Encoded Form Data

curl -X POST "${BASE_URL}/api/v1/auth/tokens" -H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
--data-urlencode "client_id=b844338a-60db-4176-9214-49b7e355e4dd" \
--data-urlencode "client_secret=ErnQBjAtlvSxI0Gc-QGwUgtNoWcvfYai-MqkJAbW9qn6iuzi" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "scope=all:read all:write"

Using JSON

curl -X POST "${BASE_URL}/api/v1/auth/tokens" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
  "client_id": "b844338a-60db-4176-9214-49b7e355e4dd",
  "client_secret": "ErnQBjAtlvSxI0Gc-QGwUgtNoWcvfYai-MqkJAbW9qn6iuzi",
  "grant_type": "client_credentials",
  "scope": ["all:read", "all:write"]
}'

Last updated

© 2024 Endorsed