Create new API Key

Circularo REST API example

API keys are tokens with long time validity. You can create an API key and then use it instead of classic token to access endpoints without need to log in multiple times.

Step 1 - Sign in

Sign user in.

Endpoint

POST - /login

Example

/login

Content-Type: application/json

{
  "name": "mary.griffin@circularo.com",
  "password": "#32Password1!",
  "tenant": "default"
}

Response

Note following properties in response object:

  • token - In response object at position ‘token‘. It may have value of “6d8uPixXYu1HtsQAQAZe9TnMh0Sx3DRD32tv56G8kyh26ivo8MPJvQpF2KUirKQk“.

Step 2 - Create API key

Creates new API key.

Endpoint

POST - /api/key

Example

/api/key?token=6d8uPixXYu1HtsQAQAZe9TnMh0Sx3DRD32tv56G8kyh26ivo8MPJvQpF2KUirKQk

Response

Note following properties in response object:

  • apiKey - In response object at position ‘id‘. It may have value of “z5b73GKuHUiCiLSiYOmp0FL6lV4XHn7awDiwxoLHGQzKcGH9DlB0rGfg2A9KopU6“.

Step 3 - Sign out (Optional)

Sign user out.

Endpoint

GET - /logout

Example

/logout?token=6d8uPixXYu1HtsQAQAZe9TnMh0Sx3DRD32tv56G8kyh26ivo8MPJvQpF2KUirKQk

The API key can be now used instead of a token. This key has the same rights as the user who created it. Standard time validity is 10 years.