Get authentication state
GET/auth
Base URL: https://api.tinkermode.com
The endpoint is used to retrieve the authentication state of an API Key. You may use this endpoint to confirm the correct Authentication header has been set for Project, User or Device API Key. For those with "Sudo" ability, you may test the Sudo API key as well.
Authentication
Send an Authorization header of the form ModeCloud <AUTH_CODE>.
Must contain a valid API key for Device, User, Service Account or Project.
Responses
200 Successfully retrieve info about the identity of the client.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
appId | string | No | read-only (server-generated) | ID of app used. This property is present if token is associated with a user authenticated via an app. |
deviceId | integer | No | read-only (server-generated) | This property is present if token is associated with a device. |
expirationTime | string | No | read-only (server-generated); format: date-time | This property is present if token has an expiration time. |
projectId | integer | No | read-only (server-generated) | This property is present if token is associated with a project. |
projectKeyName | string | No | read-only (server-generated) | This property is present if token is assocaited with a project API key. |
sudoer | string | No | read-only (server-generated) | This property is present if token is generated via sudo. |
type | unknown | Yes | read-only (server-generated); one of: user, device, project key, nobody | Type of client entity, or 'nobody' if client is not authenticated. |
userId | integer | No | read-only (server-generated) | This property is present if token is associated with a user. |
Response example
{
"appId": "controller_app",
"projectId": 1260,
"type": "user",
"userId": 2081
}500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |