web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / POST API with double q...
Power Apps
Unanswered

POST API with double quotes in string

(0) ShareShare
ReportReport
Posted on by

I'm trying to set up a POST API call in Power BI, but the API has some requirements that are giving me trouble.  One of the fields requires multiple inputs separated by commas, with each input surrounded by double quotes and the whole shebang enclosed in another set of double quotes.  For example, a request may have this field set to "P12345","P23456".  I've tested the formatting in Postman, but unfortunately I'm having trouble getting the follow up Json.Document line to parse in Power BI.

 

Here's the code I'm working with:

 

let
//API URL
 URL = "https://some.url.com/api/download",
//Declare variables for the body of the POST request, convert to Query String
 Body = " {""apikey"": ""keygoeshere"", ""format"": ""CSV"", ""partNumbers"": " & List.First(PartsList) & " }",
 Parsed_JSON = Json.Document(Body),
 BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
//Send POST request
 ZIPFile = Web.Contents(URL, [Headers=[#"Content-Type"="application/x-www-form-urlencoded"], Content = Text.ToBinary(BuildQueryString) ] ),

 


PartsList is a list of part numbers configured like I described in the first paragraph.  For some reason I can't get the list of parts to be treated as a single value, and instead Power Query is grabbing the first set of double quotes and returning an invalid character error when it gets to the second.  How can I get the query to treat the list of part numbers as a single value?

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard