In this post, I am using REST API to get the feed from a 3rd party application using client ID and client secret.
Before that, you need to already have Client ID and Client Secret which we are going to use in the API call. We are making two calls here. The first call is to fetch the access token and the second call will be using the access token we got in step one.
Overall Flow View
Steps
- Create flow from a blank template using the item created or modified in the list.
- Initialize the variables as Client ID and Client Secret.
- Add HTTP as an action event and configure as shown.
We have used POST request which will provide us with an access token which we are going to use in a later step.
The concatenation formula should contain the below text.
- concat('grant_type=client_credentials&client_id=', variables('ClientId'), '&client_secret=', variables('ClientSecret'))
- Add Parse JSON as next action because this will be parsing the records. In the content, you need to add Body as content from the HTTP Request.
Add the below text as Schema.
- {
- "type": "object",
- "properties": {
- "access_token": {
- "type": "string"
- }
- }
- }
- Add HTTP action for getting the feed records.
Here, we have selected access_token under Authorization from the PARSE JSON step.
Under Headers, we have to put
- contentType:application/json; charset=utf-8
- Authorization:Bearer @{body('Parse_JSON')?['access_token']}
This will return all the feeds based on the parameters you passed.
Cheers!!