API Reference
  • IoT IdP API Reference
  • Reference
    • HTTP API Reference
      • Token API
      • IdP API
      • Device API
    • CoAP API Reference
      • Token API
      • IdP API
      • Device API
Powered by GitBook
On this page
  • Token Endpoint
  • Request a token
  • Renew Token Endpoint
  • Refresh the token
  1. Reference
  2. HTTP API Reference

Token API

The token API is for requesting access tokens issued by our IoT identity provider.

PreviousHTTP API ReferenceNextIdP API

Last updated 2 years ago

Token Endpoint

Use this endpoint to request a new access token by authenticating with a private key JWT.

For additional details about the JWT visit our .

Request a token

POST https://iot-idp.demo.apps.iothentix.io/as/token

Request an access token by authenticating with a signed JWT.

Headers

Name
Type
Description

Authorization*

Private key JWT

Request Body

Name
Type
Description

client_id*

String

Client ID of the registered OAuth client.

scope

String

Request a scope to be present in the access token.

{
    "access_token": "<ACCESS_TOKEN>",
    "expires_in": 3599,
    "scope": "<REQUESTED_SOCPE>",
    "token_type": "bearer"
}
{
    "error": {
        "code": 401,
        "status": "Unauthorized",
        "request": "<REQUEST_ID>",
        "message": "The request could not be authorized"
    }
}
{
    "error": {
        "code": 400,
        "status": "Bad Request",
        "request": "<REQUEST_ID>",
        "message": "Bad Request"
    }
}
{
    "error": 
    {
        "code": 500,
        "status": "Internal Server Error",
        "request": "<REQUEST_ID>",
        "message": "An internal server error occurred, please contact the system administrator"
    }
}
{
    "error": 
    {
        "code": 429,
        "message": "Slow down",
        "status": "Too Many Requests"
    }
}
{
    "error": {
        "code": 404,
        "status": "Not Found",
        "request": "<REQUEST_ID>",
        "message": "The requested resource could not be found"
    }
}
{
    "error": {
        "code": 403,
        "status": "Forbbiden",
        "request": "<REQUEST_ID>",
        "message": "Forbidden"
    }
}

Renew Token Endpoint

Use this endpoint to renew the access token based on a previously issued access token.

Refresh the token

POST https://iot-idp.demo.apps.iothentix.io/as/renew/token

Request a new access token by authenticating with a previously issued access token.

Headers

Name
Type
Description

Authorisation*

String

Access token issued by the IoT provider

Request Body

Name
Type
Description

client_id*

String

{
    "access_token": "<ACCESS_TOKEN>",
    "expires_in": 3599,
    "scope": "REQUESTED_SOCPE",
    "token_type": "bearer"
}
{
    "error": 
    {
        "code": 401,
        "status": "Unauthorized",
        "request": "<REQUEST_ID>",
        "message": "The request could not be authorized"
    }
}
{
    "error": 
    {
        "code": 500,
        "status": "Internal Server Error",
        "request": "<REQUEST_ID>",
        "message": "An internal server error occurred, please contact the system administrator"
    }
}
{{
    "error": {
        "code": 403,
        "status": "Forbbiden",
        "request": "<REQUEST_ID>",
        "message": "Forbidden"
    }
}
{
    "error": {
        "code": 429,
        "message": "Slow down",
        "status": "Too Many Requests"
    }
}
{
    "error": {
        "code": 404,
        "status": "Not Found",
        "request": "<REQUEST_ID>",
        "message": "The requested resource could not be found"
    }
}
developer guide