Access Token

In order to authorize your API calls, you will need an access token. For security, the only way to programmatically obtain an access token is by exchanging it for an API key. Learn how to:


Exchange API key for access token

post

Exchange an API key for an oAuth2 access token

Body
apiKeystringRequired

The actual API key that you have received from the API key request.

Example: eyJjcnYiOiJQLTM4NCIsImQiOiJyM1VFQ21naUNiNjI1c19CZWc3emdULUlCajJUOUZW...
Responses
200
A successful response.
post
POST /v1/auth/access_token HTTP/1.1
Host: api.bytenite.com
Content-Type: application/json
Accept: */*
Content-Length: 84

{
  "apiKey": "eyJjcnYiOiJQLTM4NCIsImQiOiJyM1VFQ21naUNiNjI1c19CZWc3emdULUlCajJUOUZW..."
}
{
  "token": "eyJjcnYiOiJQLTM4NCIsImQiOiJyM1VFQ21naUNiNjI1c19CZWc3emdULUlCajJUOUZW...",
  "expiresIn": "3600",
  "scope": "text"
}


User signout

post

Log out current user and invalidates token

Authorizations
Body
objectOptional
Responses
200
A successful response.
post
POST /v1/auth/signout HTTP/1.1
Host: api.bytenite.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{
  "ok": false,
  "requestId": "xyz-123",
  "message": "Request  failed",
  "error": {
    "code": 404,
    "message": "Not Found",
    "description": "The requested resource was not found"
  }
}


Check if the user is already logged in

get

Check if the user is already logged in, if the user can skip login a redirect url is returned

Authorizations
Query parameters
loginChallengeanyOptional
Responses
200
A successful response.
get
GET /v1/auth/skip HTTP/1.1
Host: api.bytenite.com
Authorization: YOUR_API_KEY
Accept: */*
{
  "skip": true,
  "redirectTo": "text"
}

Last updated

Was this helpful?