Authentication

How to authenticate and authorize

Authentication

All requests to the Cloudadar API must be authenticated via an API token. Include your secret API token in every request you send to the API with the Authorization HTTP header.

Authorization: Bearer <token>

Now try a POST request using a read-only token. You will get a clear message along with the correct HTTP status code 403 forbidden.

Request
curl -sSX POST \
https://api.cloudradar.io/v1/ping/ \
-H 'Authorization: Bearer 002f0f852c9cb579a96c13d94a53d8357befc085ba618799'|jq
Response
{
"success": false,
"message": "Authentication failed. This is a read-only token"
}

get
Ping

https://api.cloudradar.io/v1/ping/
Ping the API
Request
Response
Headers
Authorization
required
string
Bearer <TOKEN>
200: OK
{
"success": true,
"message": "pong"
}
curl -X GET \
https://api.cloudradar.io/v1/ping/ \
-H 'Authorization: Bearer 33891543f62ead9e18c32e1252e320c2710f708d9085fd5b'

post
Ping

https://api.cloudradar.io/v1/ping/
Ping the API
Request
Response
Headers
Authorization
required
string
Bearer <TOKEN>
200: OK
positive response
{
"success": true,
"error": null,
"details": "pong"
}
403: Forbidden
negative response
{
"success": false,
"error": "Authentication failed",
"details": "This is a read-only token"
}
curl -X POST \
https://api.cloudradar.xyz/v1/ping/ \
-H 'Authorization: Bearer 33891543f62ead9e18c32e1252e320c2710f708d9085fd5b'

Rate Limiting

All requests, whether they are authenticated or not, are subject to rate limiting. If you have reached your limit, your requests will be handled by a 429 Too Many Requests error. Responses contain several objects which provide information about your current rate limit status.

The default limit is 90 requests per minute per token.

Response HTTP 429 Too many Requests
{
"success": false,
"message": "Rate limit of 90 requests per 60 seconds exceeded.",
"details": {
"wait_seconds": 58,
"wait_until": 1555517800
}
}