Forum Discussion
How do you pass and escape chars from GraphQL Query into web.contents for a REST api connections?
Hi Gao
Unfortunely the triple quotes did not work and returned the following error
Hi wdrain ,
What if you use double quotes like this?
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
- wdrain1 year agoHelper I
Hi Gao,
Thanks for replying back.
But unfortunely the double Quotes did not work.
In my finding variable names with out and dash work by escaping with a backslash \ and a double Qoute ". i.e. \"
i.e.
\"BitLocker Details\" -> this works
\"Enforce -TPM Status\" or \#"Enforce - TPM Status\" -> will not work because of the dash- Anonymous1 year agoNot applicable
Hi wdrain ,
Is it possible to show the full code (masking the private information)? Please try again something like this:
let Source = Web.Contents( "https://apiurl", [ Headers=[ #"Method"="POST", #"Content-Type"="application/json", #"Authorization"="Bearer <your_token_here>" ], Content=Text.ToBinary("{""query"": ""endpointsBitLockerDetails{endpoints(after: null, first: 200) {edges {node {idcomputerIDisEncryptedsensorReadings(sensors: [{name: \""BitLocker Details\""}, {name: \""Enforce - TPM Status\""}]) {columns {sensor {name}namevalues}}}}pageInfo {startCursorendCursorhasNextPage}totalRecords}}""}") ] ), #"JSON" = Json.Document(Source) in #"JSON"Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum