Hi All,
I'm trying to create an API call to get some basic details on classes.
I had this working in 5 minutes in Postman but seem to be struggling in Power Automate.
I have to provide filters in the call otherwise the dataset is too large.
In Postman i just add this code into the body request of the call and all works fine.
In Automate though this doesn't work.
If i use the above i get the error
The provided 'Http' action inputs are not valid. A request body must not be included for 'GET' requests.
If i try to include in The Queries section as below
I then get the error
Unable to process template language expressions in action 'GET_CLASSES_FOR_TODAY' inputs at line '1' and column '6027': 'Error reading string. Unexpected token: StartObject. Path 'queries.unified_filters'.'.
Any help on what I'm doing wrong greatly appreciated.
Andy
Hi @andycreigh ,
Are you sure it is GET Call you are making in Postman and it is returning data. Also there is code button at the top right in Postman so if you are not sure why it is not working this comes as handy.
Thanks
Thanks That code View will come in really useful.
It's def a GET call in postman. Here is a screen shot including the data returned in postman.
I have this same API returning data in MS Automate where it doesn't need the filters, so i know the API call works in principal in MS Automate.
It's knowing where to put the bit at the bottom that i think is the issue.
{"unified_filters": {
"since": "2021-12-14T01:33:04Z",
"till": "2021-12-14T22:33:04Z",
"service_category_id": 13
}}
I have tried all the options i can think of. The below for example doesnt work.
The code doesn't look like it stays in Json format if i peek the code
Andy
Hi @andycreigh ,
Two options from here :
1. Send your data in Query but with a slight modification :
"unified_filters" = {
"since": "2021-12-14T01:33:04Z",
"till": "2021-12-14T22:33:04Z",
"service_category_id": 13
}
2 . Encode this part
{
"since": "2021-12-14T01:33:04Z",
"till": "2021-12-14T22:33:04Z",
"service_category_id": 13
}
using Base64Tostring function and add that to query part
"unified_filters" = encodedstring
Let me know if these works.
Thanks
Hi @ManishJain
I'm not sure how to do option 2 or at least couldn't work it out. 🙂
Option 1 though i have set up like this. Is this right?
But I get a 406 error as below.
I really appreciate your help with this
Andy
Hi @ManishJain
I'm not sure how to do option 2 or at least couldn't work it out. 🙂
Option 1 though I have set up like this. Is this right?
But I get a 406 error as below.
I really appreciate your help with this
Andy