Skip to main content

Notifications

Power Automate - Connector Development
Unanswered

Appending a query string to an API endpoint fails

Posted on by 6
I'm attempting to append a query string created in a previous action to an API endpoint in a custom connector. However, when the call is made, the '?', '=', and '&' appear to become encoded and the call returns an error. I'm using this method as the API call requires parameter key names that include a unique value (a student's id). So, depending on the course the grades are being updated for, I would need to select the parameter key names for those specific students. To test if the connector works, I set parameter key names for two students in the custom connector which does work as intended. However, since I would need to create parameter key names for every student, this method is not feasible.
 
This is the API call which takes a parameter key name of 'grade_data[<student_id>][posted_grade] and a parameter value, which is the grade. The unencoded query string for students 1 and 2 with grades of 90 and 93, respectively, would look like the following example:
  • ?grade_data[1][posted_grade]=90&grade_data[2][posted_grade]=93
If I set the parameter key names in the custom connector, the following is shown in the request message (which works):
  • ?grade_data%5B1%5D%5Bposted_grade%5D=90&grade_data%5B2%5D%5Bposted_grade%5D=93
If I append a query string to the API endpoint, the following is shown in the request message (which returns a 404 error):
  • %3Fgrade_data%5B1%5D%5Bposted_grade%5D%3D90%26grade_data%5B2%5D%5Bposted_grade%5D%3D93
My initial guess is that the custom connector is not treating the string as a query string, and so the reserved characters are not being treated as such. Is there a way to get around this?
 
Categories:
  • Suggested answer
    FLMike Profile Picture
    FLMike 23,361 on at
    Appending a query string to an API endpoint fails
    Hi
     
    Being that it's your custom connector, its clearly doing something to encode
     
    If it was the standard HTTP you would have to encode it yourself.
     
    So I would have to see your Code, and your Connector Code (Definition etc)
     

Helpful resources

Quick Links

Welcome to the Power Platform…

We are thrilled to unveil the newly-launched Power Platform Communities!…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 140,745

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,355

Leaderboard

Featured topics