Call an API from external system with Client credentails,Use the access_token to call otherservice
Summary:
In GTM while sending screening response, we need to call a service with OAuth 2.0 and token is getting generated, how this can be stored and utilized to call another API details are shared below:
Please let us know the steps how this can be utilised.
Content (please ensure you mask any confidential information):
We need to use the below service to obtain the token
URL : https://oauth.cimpress.io/v2/token
Method : POST
Body :
{
"grant_type": "client_credentials",
"client_id": "<client_id>",
"client_secret": "<client_secret>,
"audience": "https://api.cimpress.io/"
}
The Service returns the token like below
{ "access_token":"eyJ0eXBlIjoiand0IiwiYWxnIjoiUlMyNTYiLCJraWQiOiJpZUdTNDliOGtIZ19WS0hFM0JZV1Y0MEN4SURpREFHSVJuN2hBSVZEV2ZNIn0.eyJhdWQiOiJodHRwczovL2FwaS5jaW1wcmVzcy5pby8iLCJhenAiOiJjNjliN2VhZjhhZGIzM",