Authentication¶
Client Credentials Flow¶
POST https://login.blooma.ai/oauth/token
This is the OAuth 2.0 grant that server processes use to access the Blooma API. Use this endpoint to directly request an Access Token by using your Client's credentials (a Client ID and a Client Secret) provided by Blooma for your API integration.
All data requests made to Blooma API endpoints must include a valid Access Token returned from this endpoint in the request header.
How to obtain client credentials
Reach out to your Blooma CX Manager to get Client credentials that can be used to authenticate your API integration with Blooma's APIs.
Parameters¶
grant_type string
Denotes the flow you are using. Should always be client_credentials.
audience string
The unique identifier of the target API you want to access. This will be in the format of {BASE_URL}/api/ for your dedicated Blooma instance.
client_id string
Your application's Client ID.
client_secret string
Your application's Client Secret.
Example¶
var client = new RestClient("https://login.blooma.ai/oauth/token");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\"client_id\":\"YOUR_CLIENT_ID\",\"client_secret\":\"YOUR_CLIENT_SECRET\",\"audience\":\"BASE_URL/api/\",\"grant_type\":\"client_credentials\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var request = require("request");
var options = {
method: 'POST',
url: 'https://login.blooma.ai/oauth/token',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
form: {
client_id: YOUR_CLIENT_ID,
client_secret: YOUR_CLIENT_SECRET,
audience: `${BASE_URL}/api/`,
grant_type: 'client_credentials'
}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
import json
import http.client
conn = http.client.HTTPSConnection("login.blooma.ai")
payload = {
"client_id": YOUR_CLIENT_ID,
"client_secret": YOUR_CLIENT_SECRET,
"audience": f"{BASE_URL}/api/",
"grant_type": "client_credentials"
}
headers = { "content-type": "application/json" }
conn.request("POST", "/oauth/token", json.dumps(payload), headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
You can then use the returned token_type and access_token to access the Blooma API
by including the following header in subsequent requests.