GET/v1/tokens/verify

Verify a token

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Responses

StatusMeaningDescription
200OKReturns that the given API token is valid
401UnauthorizedReturns an error message if the token is invalid
500Internal Server ErrorInternal Server Error

Response Schema

Status Code 200

NameTypeRequiredDescription
» resultobjecttruenone
»» idstringtrueToken ID
»» statusstringtrueStatus
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Status Code 401

NameTypeRequiredDescription
» resultnulltruenone
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertrueError code
»» messagestringtrueA message to describe the error
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Request

GET
/v1/tokens/verify
curl --request GET \
  --url https://api.onlineornot.com/v1/tokens/verify \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "id": "a1b2c3d4",
    "status": "active"
  },
  "success": true,
  "errors": [],
  "messages": []
}

GET/v1/tokens/permissions

Retrieve a token's permissions

Security: Bearer Auth

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer 123

Responses

StatusMeaningDescription
200OKReturns the permissions of a given API token
500Internal Server ErrorInternal Server Error

Response Schema

Status Code 200

NameTypeRequiredDescription
» resultobjecttruenone
»» permissions[string]truenone
» successbooleantrueWhether the API call was successful
» errors[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone
» messages[object]truenone
»» codenumbertruenone
»» messagestringtruenone
»» typestringfalsenone

Request

GET
/v1/tokens/permissions
curl --request GET \
  --url https://api.onlineornot.com/v1/tokens/permissions \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer {access-token}'

Response

{
  "result": {
    "permissions": [
      "uptime_checks (read)"
    ]
  },
  "success": true,
  "errors": [],
  "messages": []
}

Was this page helpful?