The first operation to be performed before being able to access to the API is authentication.
The user shall be registered on the portal. See your administrator to get an account.
See Authentication section of the API reference for detail information.
The end user has to call the POST /auth/token
endpoint to create a access token.
See Token section for API reference on this call.
For example:
curl 'https://api-console-lab.intercloud.io/auth/token' \
-X POST \
-H 'authorization: Basic MTIzNDphYWJiY2NkZA==' \
-H 'Content-type: application/json' \
--data '{
"grant_type": "password",
"password": "horse bottle sidecar computer",
"scope": "everything",
"username": "john.lennon@apple.uk.co"
}'
Note:
grant_type
shall always be equal to “password”,scope
shall always be equal to “everything”
The API provides an access token if user is registered:
{
"access_token": "XS12zK1pTMS8VegiHkcvtA",
"expires_in": 3600,
"refresh_token": "8oBxvcomQVK3yEywJI8akQ",
"scope": "everything",
"token_type": "Bearer"
}
The access token is supposed to be provided in an Authorization
header in every request to grant access to the API.
Example for curl calls:
-H "Authorization: Bearer XS12zK1pTMS8VegiHkcvtA"