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

PropertyTypeRequiredConstraintsDescription
appIdstringNoread-only (server-generated)ID of app used. This property is present if token is associated with a user authenticated via an app.
deviceIdintegerNoread-only (server-generated)This property is present if token is associated with a device.
expirationTimestringNoread-only (server-generated); format: date-timeThis property is present if token has an expiration time.
projectIdintegerNoread-only (server-generated)This property is present if token is associated with a project.
projectKeyNamestringNoread-only (server-generated)This property is present if token is assocaited with a project API key.
sudoerstringNoread-only (server-generated)This property is present if token is generated via sudo.
typeunknownYesread-only (server-generated); one of: user, device, project key, nobodyType of client entity, or 'nobody' if client is not authenticated.
userIdintegerNoread-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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.