Legacy Dev Forum Posts

 View Only

Sign Up

Power Query from Power BI get the Conversation details query

  • 1.  Power Query from Power BI get the Conversation details query

    Posted 06-05-2025 19:20

    Veeraiah_Mannem | 2020-06-29 17:00:49 UTC | #1

    I am trying to call the https://api.mypurecloud.com/api/v2/analytics/conversations/details/query from the Power BI, but getting the bad request 400

    let Content= "{ ""query"": [ { ""interval"": ""2020-06-24T04:00:00.000Z/2020-06-25T04:00:00.000Z"", ""order"": ""asc"", ""orderBy"": ""conversationStart"", ""paging"": { ""pageSize"": 25, ""pageNumber"": 1 } } ], ""response"": { ""format"": ""json"" } }", Source = Json.Document(Web.Contents("https://api.mypurecloud.com/api/v2/analytics/conversations/details/query", [Headers=[Authorization="Bearer DO NOT POST YOUR AUTH TOKEN PUBLICLY", Accept="application/json", #"Content-Type"="application/json"] ,Content=Text.ToBinary(Content)])) in Source

    Error: DataSource.Error: Web.Contents failed to get contents from (400): Bad Request

    Any help?


    Jerome.Saint-Marc | 2020-06-29 15:41:37 UTC | #2

    Hello,

    I am not familiar with Power Query from Power BI.

    But a 400 Bad Request would indicate that your request has a malformed syntax.

    Are you sure about the format/value of your Content variable (I mean the use of "query" and "response" attributes)?

    If the Content variable is (exactly) supposed to be the body of your HTTP POST request to https://api.mypurecloud.com/api/v2/analytics/conversations/details/query, then it should just be:

    Content= "{ ""interval"": ""2020-06-24T04:00:00.000Z/2020-06-25T04:00:00.000Z"", ""order"": ""asc"", ""orderBy"": ""conversationStart"", ""paging"": { ""pageSize"": 25, ""pageNumber"": 1 } }",

    Unless the use of "query" and "response" attributes in your Content variable corresponds to some specific settings on Power Query/Power BI side.

    Regards,


    tim.smith | 2020-06-29 17:02:38 UTC | #3

    @Veeraiah_Mannem Do not post auth tokens publicly as anyone with your auth token can access your org. Auth tokens must be handled like passwords. Please take steps to change your Genesys Cloud user's password, secure your org, and check for unauthorized access immediately


    system | 2020-07-30 17:02:39 UTC | #4

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


    This post was migrated from the old Developer Forum.

    ref: 8131