Requesting a token
Make.com strangely does not support OAuth2 Client Credentials flow out of the box. The first step is to generate a session token from your Trelica API credentials.
Search for, and add the HTTP module:
Choose Make a Basic Auth request:
Click to Add your credentials:
The Username is your Client ID, and the Password is your Client Secret:
Click Create.
- Set the URL to
https://app.trelica.com/connect/token
If you're on our EU instance, then usehttps://eu.trelica.com
as a host in all these instructions. - Choose
POST
for the Method. -
Body type should be
Application/x-www/form-urlencoded
- Add a Field called
grant_type
with the valueclient_credentials
- Set Parse response to Yes.
Click OK.
Now click Run once to run your request to test it out.
It should come back green - click the 1 to view the response. You should see the access_token in the response.
Storing the access token
We now want to put the access token in a variable for re-use.
Select the Set variable tool:
Link your first HTTP action to the Set variable tool, and then click on it to specify what you want to call the variable and the value you want to set:
Variable name | token |
Variable lifetime | One execution |
Variable valueC |
Click in the field and pick Data > access_token
|
Making the API call
Now add a new HTTP module, and link it to the Set variable step.
This time choose Make a request (i.e. not Basic Auth).
- Set the URL to
https://app.trelica.com/api/apps/v1
(or whichever endpoint you want to call). - Select the appropriate Method, e.g. for this endpoint GET.
- Add a Header called
Authorization
. The value must be the textBearer
, followed by a space, and then select the token variable you created earlier. - Set Parse response to Yes.
Click OK, and now re-run the whole workflow.
You should see the application list in the Output:
Comments
0 comments
Please sign in to leave a comment.