Hi Sagar,
In the "Authorization" header are you actually base64 endcoding the client id and secret and sending the encoded string?
For instance if I have the following client id = "Jim" and secret = "Crespino". If I base64 encode "Jim:Crespino", then I get the string "SmltOkNyZXNwaW5v". Then my Authorization header value should be "Basic SmltOkNyZXNwaW5v".
Most programming languages have libraries that will perform a base64 encode routine. If you need to do it manually then there are many online tools, such as this one: https://www.base64encode.org/
Note, base64 encoding is not encrypting. You can easily decode any encoded string, so please continue to protect the client id and secret, as they are essentially a username and password to your org with authorization to perform any API request granted by the permissions of the role assigned to that OAuth client.
By the way, you might consider posting development related questions into the Genesys Cloud Developer Forum at https://developer.genesys.cloud/forum.
Cheers,
------------------------------
Jim Crespino
Senior Director, Developer Evangelism
Genesys
https://developer.genesys.com------------------------------
Original Message:
Sent: 06-04-2024 10:05
From: Sagar Tawde
Subject: API to get Access Token for Client Credentials Grant Type
Hi Guys,
I am trying to use the following API
POST https://login.usw2.pure.cloud/oauth/token
with Header
Body,
grant_type=client_credentials
I replaced the client ID and Secret with required Oauth Integration, but it seems to give me 400 error
{"error":"invalid_client","description":"no client id provided","error_description":"no client id provided"}
I need your eye to check to see if I am doing anything wrong or need to cater for anything else apart from what is posted above.
Would appreciate your assistance.
#Integrations
------------------------------
Sagar Tawde
MetLife Services and Solutions, LLC
------------------------------