Legacy Dev Forum Posts

 View Only

Sign Up

Api Download Recordings APP .NET

  • 1.  Api Download Recordings APP .NET

    Posted 06-05-2025 18:05

    MINNELLYJAKELINELU | 2018-12-11 22:45:27 UTC | #1

    Hi, I'm making some changes to the code for downloads using the api directly and not the libraries, but I have a problem when sending the query parameters to get the conversations, as you can see in the image I am returning an error 400 indicating that the search statement is not correct, maybe it can help me how can I send the search parameter?

    Código: 400

    Bad.Request


    tim.smith | 2018-12-11 22:49:19 UTC | #2

    Please provide the response body and the correlation ID as text in your reply.


    anon28066628 | 2018-12-12 15:23:49 UTC | #3

    The response should give a reason for the failure, but first glance, it looks like your interval is too long for the details query. It's limited to 32 days if you provide a filter, or 7 days with no filter.


    MINNELLYJAKELINELU | 2018-12-12 17:18:06 UTC | #4

    I'm making a new code and in the part I need help is when I send the filter for conversations, so the error that I reported is in the beginning, I need to know how to send that query, the error that comes up is because when I use the api "/ api / v2 / analytics / conversations / details / query" and I hope you return the results I get the error that I'm not sending the data correctly, I do not know if you explain well and can help me solve it?

    Therefore, I do not have a correlation ID yet.


    tim.smith | 2018-12-12 17:21:18 UTC | #5

    Please provide the body of the response. You should be able to access the correlation ID in the response header also. Error responses also have correlation IDs.


    MINNELLYJAKELINELU | 2018-12-12 17:58:59 UTC | #6

    I'm using the api "/api/v2/analytics/conversations/details/query" and send the body "{\"interval\":\"2018-11-30T00:00:00/2018-11-30T23:59:59\"}" but the response is "StatusCode:400", how do I send the body to the api?, I'm programming in C#


    tim.smith | 2018-12-12 19:04:02 UTC | #7

    I'm looking for the body in the response. The response is what gets sent to your app by PureCloud. The response body usually contains an error message telling you what's wrong with your request. A 400 response code tells you that your request was incorrect, but you need to look at the error body to figure out what. In your code, you have a variable called response. Can you try and retrieve the response body from that?


    MINNELLYJAKELINELU | 2018-12-12 19:39:23 UTC | #8

    The response is: "Code: 400, ReasonPhrase: BadRequest", I don't known if the body what I sent is correctly.


    tim.smith | 2018-12-12 19:40:38 UTC | #9

    I know for sure the body you sent is wrong because you're getting a 400 response back. Please provide the body from the response. I can't help you until you provide the necessary information.


    MINNELLYJAKELINELU | 2018-12-12 19:49:56 UTC | #10

    I'm programming in C#, the body what I sent is "{\"interval\":\"2018-11-30T00:00:00/2018-11-30T23:59:59\"}", I sent of the next form: HttpResponseMessage response = await client.PostAsJsonAsync("/api/v2/analytics/conversations/details/query", body); I don't know if in C# the use of the api is correct, I don't find informtation about how use the api in C#.


    anon28066628 | 2018-12-14 17:28:30 UTC | #11

    Hi Minnelly, this reference might help you get the actual JSON response body from your query. The 400 Bad Request is only the response code. The response should have a body along with it, including the reason why the request body is incorrect.

    https://stackoverflow.com/questions/32167021/getting-full-response-body-from-system-net-webrequest

    The correlationId should also be in the response body, and/or a response header.


    system | 2019-01-14 17:28:32 UTC | #12

    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: 4164