Forum Discussion
Use cURL in PowerBi
Is it possible to connect dataset via cURL to PowerBI ?
I have cURL generate by graphql but not sure i I can use it somehow in PB
curl 'https://api.com/graphql' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://api.com' -H 'access_token: ' --data-binary '{"query":"# Write your query or mutation here\n{\n members{\n data{\n user{\n name\n }\n }\n }\n}\n"}' --compressed
4 Replies
- wabanekFrequent Visitor
So far I managed to create below m code but i doesnt work. Im newbie to M language, can someone support me with it?
let apiUrl = "https://apiname.com/graphql", options = [Headers =[#"Content-Type"="application/json", #"Subscription-Key"="<my token>"], Content = Text.ToBinary({"query:{\n members{\n data{\n user{\n name\n }\n }\n }\n}\n"}) ], Content = options[Content] in ContentError message: We cannot converte List type to Text type
- v-juanli-msftCommunity Support
Hi wabanek
Do you want to connect to the Microsoft Graph Security API?
If so, please follow this this article to use the Microsoft Graph Security connector of Power BI Desktop.
If you'd like to connect to your secure API like this article
In the editor, enter the API’s address and any header information needed for that api.
After this, when a warning message pops up, Click “Edit Credentials”
let
apiUrl = "https://xxxxxxx/api/info",
options = [Headers =[#"Subscription-Key"="xxxxxxxxxxxxxxxxxxxxx"]],
result = Web.Contents(apiUrl , options)
in
result
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- wabanekFrequent Visitor
Thanks Maggie for you reply. I'm Trying to connect to secure Api, tried your step and not sure how to move further, could you advise