Create Access Token
Decision Cloud issues short-lived OAuth2.0 access tokens that have set expirations of 1 hour. You can retrieve a new access token at any time by simply making a new request to this endpoint. The passed token informs the API that the bearer of the token has been authorized to access the API and perform specific actions specified by the Scope that was granted during authorization.
WARNING
Always keep your token safe and reset it if you suspect it has been compromised.
Header Parameters
Request Parameters
grant_type
stringrequiredclient_credentials
client_id
stringrequiredThe Decision Cloud Client ID.
client_secret
stringrequiredThe Decision Cloud Client Secret.
Response Parameters
POST /oauth/token
sh
curl --request POST \
"https://api.decisioncloud.me/oauth/token" \
--header "Content-Type: application/x-www-form-urlencoded" \
--header "Accept: application/json" \
--data "grant_type=client_credentials&client_id=947a61d5-cf05-49c7-8972-1cfb3a67409b&client_secret=9W760BL4NuXKOw9mgDi8DIGP6E2ejgkpBjKm92No"js
const url = new URL(
"https://api.decisioncloud.me/oauth/token"
);
const headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json",
};
let body = "grant_type=client_credentials&client_id=947a61d5-cf05-49c7-8972-1cfb3a67409b&client_secret=9W760BL4NuXKOw9mgDi8DIGP6E2ejgkpBjKm92No";
fetch(url, {
method: "POST",
headers,
body: body,
}).then(response => response.json());php
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.decisioncloud.me/oauth/token',
[
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
'Accept' => 'application/json',
],
'form_params' => [
'grant_type' => 'client_credentials',
'client_id' => '947a61d5-cf05-49c7-8972-1cfb3a67409b',
'client_secret' => '9W760BL4NuXKOw9mgDi8DIGP6E2ejgkpBjKm92No',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));py
import requests
import json
url = 'https://api.decisioncloud.me/oauth/token'
payload = {
"grant_type": "client_credentials",
"client_id": "947a61d5-cf05-49c7-8972-1cfb3a67409b",
"client_secret": "9W760BL4NuXKOw9mgDi8DIGP6E2ejgkpBjKm92No"
}
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, data=payload)
response.json()json
{
"token_type": "Bearer",
"expires_in": 31536000,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI5MmZkYjc3MS00MDA4LTRlOWQtODFmMS0wNWFiNmQwODRkYWYiLCJqdGkiOiI1ZTg5OTRmNWU3YmNiNzM2YjRlMmM1NmY2NzEyMTAxYTg0MWNiYWJkY2E0MmZkMjQ1M2Y5MjE1YmMxZGNjMmM1N2I3NWViZGRjMWFmZDFkNSIsImlhdCI6MTYzMjUyNjcyMi41ODM3NTQsIm5iZiI6MTYzMjUyNjcyMi41ODM3NjksImV4cCI6MTY2NDA2MjcyMi41NDg0MTksInN1YiI6IiIsInNjb3BlcyI6W119.G7BLHOKW0rSmrxmz-IybgZpvMaBGt_PMCtRy7sxPOjTl3M1bRv6bTd8vsGIrPMMFIroO8IeF2x0Z-VUueVBg3iZ8_eZNZ9IMXTCfXYYlhWsNwIITPp7yzwfwCvLi1XBl-Kk-LxqPTDbBDgszIu_3Uxzzcz9xPtwmQr9-Eu1gZFHOwxKHltNYL2i2vJvGFqZRmmz7GfZ7xLJ_gooOHXQGc-OYeXHCuNdZln6cQ-BYuwNvMKYCLsXIsMBcfCSAvV__7LeyCcMsgui2AAFZRUgRKRc8nfRctvMK-0ukD4ZeadgdFO878GnNjnLp9qHkL7aO1R7gAcjoOmY79xXLrfpeyJ_1EzKEzJu1nOvjL064XbeCWbLak6phSpEGjZdczIeCGOVbrI_QhaPXgk9nqRldFQiYpeWEYzdu9RA2Wuv1p09Atu2y9GrjW1Z-50PEt1JysOhOY9Ww5wT-Akvze7LK0E_9AdC7o5qsC8kTAT_LeoIXVnYlT8Uldp1HKxqEH7V-xEsfh-mDeEQ8feQZRW1Dd1RyzmX1N6G_gBg0LUB4C0g00pk6vZDFmlLUw2ftzGoPbxTuN9Xx3mEGPhINPALEtpELoh_Wfskh3MYudObhQ395qnaCMULVk_wdPqPt2ueI1gZLKqh9eEvb5h_LHyIBZ-4IXi_bXgQyxNPYNHfk19Q"
}