You use the Lucidum API to authenticate API access. This chapter explains the authentication endpoint.
Authentication: /v1/access_token #
The endpoint to authenticate for API access is /v1/access_token.
Endpoint |
Method |
Parameters in Request Body |
---|---|---|
/v1/access_token. |
POST |
|
Example #
This API uses the POST method. If you are using cURL, specify “curl -X POST”.
Using cURL and the URL and endpoint “https://demo.lucidum.cloud/CMDB/v1/access_token”, we could use something like this to authorize:
'https://demo.lucidum.cloud/CMDB/v1/access_token' \
-H 'accept: */*' \
-H 'Content-Type: application/json' \
-d '{
"clientId": "eVLZvAgzsSEyQjxOXrdX",
"secret": "XdwQpiwXNWlAYjmYwOimycgaOKYbxEvTvsdAFRZv",
}'
- curl -X ‘POST. Use the POST method instead of the default GET method.
-
https://172.22.140.107/CMDB/v1/access_token. The URL and endpoint for the API request.
-
-H ‘accept: */*’. This argument includes data in the header of the request. The argument tells cURL to accept all media types for a return.
-
-H ‘Content-Type: application/json’. This argument includes data in the header of the request. This argument specifies that the request body will be in JSON format. Lucidum recommends you use this format.
-
-d. This argument specifies that the text within the single quotation marks and curly brackets is the request body.
-
clientId. In this name: value pair, specify the Client ID for your Lucidum account that you retrieved from the Lucidum UI.
-
secret. In this name: value pair, specify the Secret for your Lucidum account that you retrieved from the Lucidum UI.
The response would look like this:
{
"code": 200,
"data": {
"token": "*******************************"
},
"message": "success"
}
-
code: 200. This name value pair specifies the status of the request. In our example, the request was successful.
-
token: value pair. The value is the bearer token for the Lucidum API. Copy this value and store it safely. You can then include this token value in the header for other API calls to Lucidum.
-
“message”: “success”. This name value pair specifies the status of the request. In our example, the request was successful.