Authorization
Except for login, all the requests need to add the authentication field.
The CloudTower API makes authentication by passing the Authorization
field in the headers. Here is how to get a token, using cURL as an example:
curl -X 'POST' \
'http://CLOUDTOWER_IP/v2/api/login' \
-H 'accept: application/json' \
-H 'content-language: en-US' \
-H 'Content-Type: application/json' \
-d '{
"username": "string",
"source": "LOCAL",
"password": "string"
}'
And here is what can be obtained:
{
"task_id": "string",
"data": {
"token": "string"
}
}
The data.token
is the authentication field to be used, you can just add it to header.Authorization
.
- If called via cURL, add
-H 'Authorization: token-string'
. - If called via the swagger api documentation page, click the
Authorization
button and adddata.token
tovalue
.