Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hey,
Hi I am trying to send a REST POST API request.
This is the URL: https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query
This is the body:
I'm trying to send this request in PowerBI, and this is what i got until far.
I don't know where am I wrong...
let
url="https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query",
body= "{
""interval"": ""2022-04-18T08:00:00.000Z/2022-04-18T08:30:00.000Z"",
""groupBy"": [
""userId""
],
""metrics"": [
""tTalk""
],
""filter"": {
""type"": ""and"",
""predicates"": [
{
""dimension"": ""mediaType"",
""value"": ""voice""
}
]
},
""paging"": {
""pageSize"": 25,
""pageNumber"": 1
}
}",
json="{""mediaType"":""voice"",""userId"":"" ************* "",""interval"":""2022-04-18T08:00:00.000Z/2022-04-18T08:30:00.000Z"",""metric"":""tTalk"",""max"":""52950"",""min"":""52950"",""count"":""1"",""sum"":""52950""}",
Parsed_JSON = Json.Document(json),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
WebCall = Web.Contents(url, [Headers=[Authorization="Bearer ***************************", Accept="application/json", #"Content-Type"="application/json"]]),
LinesFromBinary = Lines.FromBinary(WebCall),
#"Converted to Table" = Table.FromList(LinesFromBinary, Splitter.SplitTextByDelimiter(":"), null, null, ExtraValues.Error)
in
#"Converted to Table"
Would appreciate your help 🙂
@Anonymous @Post
Solved! Go to Solution.
We don't support authenticating to a website in this way. The only supported way is to use a custom connector.
That being said:
To make a POST call add:
WebCall = ... #"Content-Type"="application/json"],Content=Json.Document(Parsed_JSON)])
You can remove the unused BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
We don't support authenticating to a website in this way. The only supported way is to use a custom connector.
That being said:
To make a POST call add:
WebCall = ... #"Content-Type"="application/json"],Content=Json.Document(Parsed_JSON)])
You can remove the unused BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
Hi @yaelmo ,
you have to use the "Content"-parameter to create a POST request in Power Query:
Easy POST requests with Power BI and Power Query using Json.FromValue – The BIccountant
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
This is my first time working with Power Query, I didn't understand how i need to apply this on my request.
Can you please guide me in more detail?
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.