Connecting with power bi

Hi, I am trying to connect to this API: https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query
using PowerBI but I'm getting an error.

My query is:

let
Content= "{
""query"": [
{
{
""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
}
}
],
""response"": {
""format"": ""json""
}
}",
Source = Json.Document(Web.Contents("https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query", [Headers=[Authorization="Bearer -------------------", Accept="application/json", #"Content-Type"="application/json"]]))
in
Source

and I'm getting this error :

Can't figure out what's missing, I'd love help :slight_smile:

Hello,

I don't know anything about Power BI but doing a Google Search and seeing the query you have posted above, are you sure you are sending an HTTP POST with a body?

I don't see you passing Content to your request (the request body). And in this case, according to this PowerQuery article, if no Content (body) is set, it will trigger an HTTP GET.
Which would explain why the request is rejected by Genesys Cloud with 405 Method Not Allowed - as this API endpoint is supported via HTTP POST only.

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.