Using the OAuth2 Client Credentials grant with the HTTP module
The Client Credentials grant type enables Make to obtain an access token with the help of Client ID and Client Secret. Make doesn't support the Client Credentials Grant flow of creating an OAuth 2.0 connection in the HTTP - Make an OAuth 2.0 request module. However you can use the HTTP - Make a request module to get an access token and then make an API call.
Important
You need to know your Client ID and Client Secret to get an access token. Read about getting credentials.
Get an access token
First, you need to make a request for getting an access token from the service.
In your scenario, add the HTTP - Make a request module.
In URL, enter the request URL for getting the access token.
Tip
Refer to the app API documentation to get the request URL.
In Method, select the appropriate method for the endpoint
Optional: In Headers, specify a request header.
Optional: In Query String, enter needed parameters.
In Body type, select one of the following:
The Raw option. Proceed to the step 7.
The Application/x-www-form-urlencoded option. Proceed to the step 9.
In Content type, select JSON (application/json).
In Request content, enter the request that should contain the following:
The grant type: client_credentials.
Your Client ID.
Your Client Secret.
Optional: scopes required by the service.
Tip
The request example:
{
"grant_type": "client_credentials",
"client_id": 4342c38243cb2o84732c234c
"client_secret": 34sdf7843fno8s7dg
}
In case you chose the Application/x-www-form-urlencoded body type: In Fields, add the grant type, the Client ID, and the Client Secret.
Run the module.
In the modules output, you get an access token and a token type:
Authorize in the service
After getting the access token, you can make the desired OAuth 2.0 request to the service using the same type of HTTP modules.
In the same scenario, add the second HTTP - Make a request module.
In URL, enter the a request URL for an endpoint you want to reach.
In Method, select the appropriate method for the endpoint.
In Headers, add an item:
Name: Authorization.
Value: enter the token type you got in the output of the previous module, and map the value itself.
Note
In this example, the token type is Bearer, but it may vary depending on an app.
Some apps API require additional headers. Refer to the app API documentation to learn about the token type and headers.
You can make the needed request using the client credentials grant type.