Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Search call history

    Posted 06-05-2025 18:10

    pierrick | 2016-06-27 13:07:39 UTC | #1

    Is there a way to search for a phone number using the API to retrieve contact history information?


    pierrick | 2016-06-27 13:13:48 UTC | #2

    And by searching a phone number, I meant searching in my own org for a specific number. Should I use the Analytics API for this? If so, would the POST /api/v2/analytics/conversations/details/query be the best place to start?


    tim.smith | 2016-06-27 20:24:09 UTC | #3

    Yep, you're on the right track. Historical information must be retrieved using analytics. Here's a request I made that returned all conversations in the interval that had a participant whose ANI contained "317":

    POST /api/v2/analytics/conversations/details/query HTTP/1.1 Host: api.mypurecloud.com Authorization: bearer mytoken Content-Type: application/json

    { "interval": "2016-06-14/2016-06-21", "segmentFilters": [ { "type":"or", "predicates": [ { "dimension": "ani", "value": "317" } ] } ] }

    You can get more information about this type of query here: https://developer.mypurecloud.com/api/rest/v2/analytics/conversation.html


    Ben_Carroll | 2017-01-26 22:00:39 UTC | #4

    When going through the AnalyticsConversationQueryResponse object, What data item represents the phone number dialed by one of our agents? The only thing I can find that might be it is the "DNIS". Is this correct?


    tim.smith | 2017-01-26 22:25:43 UTC | #5

    Yes, the DNIS on the user/agent participant indicates the number dialed.


    system | 2017-08-28 19:25:03 UTC | #6


    This post was migrated from the old Developer Forum.

    ref: 100