API access
An API token cannot be created
| Message | Cause | Remedy |
|---|---|---|
| Must be a whole number between 1 and 90. | The validity period lies outside the permitted range. | Enter a whole number between 1 and 90 days. |
| This field is required. | The name of the token is missing. | Assign a name by which you will recognise the token later. |
| There was a problem creating the token. Please try again. | The server did not create the token. | Repeat the procedure. |
| There was a problem deleting the token. Please try again. | The server did not delete the token. | Repeat the procedure. |
Note
Please copy your new API token. For your security, it will not be shown again. If you did not copy the token before closing the dialog, it cannot be read back afterwards. Delete it and create a new one.
The procedure is described in Creating an API token.
The API rejects a request
| Response | Cause | Remedy |
|---|---|---|
400 Bad Request |
The request is incomplete or contains an invalid value. | The returned ViolationVO object names the field and the reason. Correct the value and send the request again. |
401 Unauthorized |
The bearer token is missing, misspelled, or expired. | Check the Authorization: Bearer <token> header. A token is valid for 90 days at most; after that, create a new one. |
403 Forbidden |
The user account behind the token lacks the permission for this endpoint — or the identifier in the path does not exist or belongs to a different company. The API answers both the same way so that it does not disclose identifiers of others. | First check the identifier in the path, then the role of the user account. |
429 Too Many Requests |
240 requests per minute are allowed, counted per user account. | Spread the requests over time. Evaluate the Retry-After header of the response and repeat the request afterwards. |
The complete list is given in Possible responses to a request.
A SOC account gets no access with its API token
If the API rejects a request with SOC accounts cannot access organisation-scoped data with a personal access token., this is not an error but a safeguard: a SOC account owns no networks of its own. Over a personal API token it would return the data of whichever company it last switched into.
- ► Address the company in the path explicitly: use the endpoints under
/organisations/{organisation}/…instead of the endpoints without a company in the path.