API
Learn how to use the public API
The CloudRadar API operates over HTTPS and uses JSON as its data format. The API is a RESTful API and utilizes HTTP methods and HTTP status codes to specify requests and responses.
Our API is still under development. Don't hesitate sending an email and ask for more endpoints. We are curious to read what you plan to build with our API.
To get started using the API you first need an API token. Sign in into the https://my.cloudradar.io and choose API on the main menu. Create a new token. Two kinds of tokens can be generated. Read-Write and Read-Only tokens. Read-only tokens can only perform HTTP GET requests. Let’s say your new token is
002f0f852c9cb579a96c13d94a53d8357befc085ba618799
.You’re now ready to make your first request against the API.
curl -X GET \
https://api.cloudradar.io/v1/ping/ \
-H 'Authorization: Bearer 002f0f852c9cb579a96c13d94a53d8357befc085ba618799'
api-ping.py
#!/usr/bin/env python
import requests
token = '002f0f852c9cb579a96c13d94a53d8357befc085ba618799'
url = 'https://api.cloudradar.io/v1/ping/'
headers = { 'Authorization': 'Bearer '+token }
response = requests.request("GET", url, headers=headers)
print(response.status_code)
print(response.text)
Make sure to replace the token in the example command with the token you have just created.
You should get back along with HTTP Status Code 200
{
"success": true,
"message": "pong"
}
If you want to discover the API using the command line tool curl and you want a nicely formatted output consider using
jq
.curl -sSX GET \
https://api.cloudradar.io/v1/ping/ \
-H 'Authorization: Bearer 002f0f852c9cb579a96c13d94a53d8357befc085ba618799'|jq
Last modified 4yr ago