Legacy Dev Forum Posts

 View Only

Sign Up

Get conversation from ContactID

  • 1.  Get conversation from ContactID

    Posted 06-05-2025 18:06

    SUpadhaya | 2020-07-23 21:22:21 UTC | #1

    Is there a way for us to use the given Genesys ContactId to lookup the latest conversation, so we can get the conversation in relation to that call?


    ConcordAbush | 2020-07-23 21:16:48 UTC | #2

    SUpadhaya, post:1, topic:8380
    e the given Genesys ContactId to lookup the latest conversation, so we can get the conversation in relation to that call?

    This is using the .NET SDK and currently we get the ContactId from a Rule/Action being that sends us the contactID at the end of a call. I have not found anything in the API that allows us to get information about a contacts call history. Any help would be appreciated.


    Jerome.Saint-Marc | 2020-07-24 08:40:19 UTC | #3

    Hello,

    You could do this with a query for conversation details (Analytics API). This request allows to set a segment filter that leverages the externalContactId dimension.

    Until recently, the contact lookup and update of externalContactId was done when the call was reaching the Contact Center agent. PureCloud now verifies the contact when the interaction begins. See here and here.

    As an example, the following request will look for all conversations that occurred in the last month (Interval from June 24th to July 24th) for a specific contact id (replace yourexternalcontact_id below with your contact id). The results are ordered from most recent to oldest (order = desc), retrieving at max 25 conversations (pageSize = 25).

    POST /api/v2/analytics/conversations/details/query With body: { "interval": "2020-06-24T22:00:00.000Z/2020-07-24T22:00:00.000Z", "order": "desc", "orderBy": "conversationStart", "paging": { "pageSize": 25, "pageNumber": 1 }, "segmentFilters": [ { "type": "or", "predicates": [ { "type": "dimension", "dimension": "externalContactId", "operator": "matches", "value": "yourexternalcontact_id" } ] } ] }

    Regards,


    ConcordAbush | 2020-07-24 15:11:42 UTC | #4

    Jerome.Saint-Marc, post:3, topic:8380
    results are ordered from most recent to

    Thank you for this fast reply. We will try to implement a query as you described and see if we can get the information that we are looking for. Thank you.


    ConcordAbush | 2020-07-24 20:32:17 UTC | #5

    Jerome,

    I realized that the information we are given is a ContactID not the ExternalContactID that you reference. I did find an API call inside of the externalContactsAPI that should allow me to use a ContactId to get the ExternalContactId but I am running into a permission is missing. Do you know what role would allow the ability to make the call?

    Error we are currently receiving: Error calling GetExternalcontactsContact: {"message":"Unable to perform the requested action. You must have at least one of the following permissions assigned: [externalContacts:contact:view, relate:contact:view]","code":"missing.any.permissions","status":403


    I just wanted to update that I did get the query to work after granting permissions but the ContactID that is generated and passed to us from a Contact List .CSV upload does not associate with any ExternalContacts.

    Do uploaded Contacts not count as External Contacts? How do we setup those types of contacts?

    If this is more of an integration question let me know and I will post in that forum.


    Jerome.Saint-Marc | 2020-07-27 05:38:14 UTC | #6

    Hello,

    Could you explain what you mean by Contact ID? What type of id/identifier? ID of a contact stored where?

    What I was referring to was the id (object id) of a contact (firstname, lastname, phone number, email) stored in PureCloud. They are called: External Contacts. https://help.mypurecloud.com/articles/about-external-contacts/

    When a call/chat/email is made to PureCloud, and if the originator of the interaction is recognized (if an external contact exists in PureCloud with a phone number/email matching the one of the incoming interaction), the PureCloud Conversation context will then contain an attribute named externalContactId with a value equal to the id (object id) of that contact.

    Regards,


    ConcordAbush | 2020-07-27 15:24:03 UTC | #7

    Jerome.Saint-Marc, post:6, topic:8380
    D? What type of id/identifier? ID of a contact stored where?

    What I was referring to was the id (object id) of a contact (firstname

    What I was referring to as ContactID is a value that is pushed from PureCloud to a server on our side using the Integration Actions triggered by a rule on a Campaign call list. This Campaign calls a list of contacts that we upload via a *.CSV file containing information about the contact for an agent to use as well as the contact number which PureCloud uses to auto dial the customer. When the call ends for what ever reason the rule takes place and information is sent to us and one of the fields that PureCloud provides is called ContactID. It appears to be a GUID from the number of characters in the string but is missing the '-'.

    I did find the ExternalContactID that you mentioned but that ID is not associated with any of the contacts in our list. We currently only have one test contact setup that way which another employee did for their own testing for a different item being worked on.


    Jerome.Saint-Marc | 2020-07-27 15:34:51 UTC | #8

    I can't say much about it. I mean - could it be a value that corresponds to the ID of a contact stored in an external system, and which is part of the calling list? When you import a CallingList, it is possible to add a set of custom columns/attributes? If you see a field for ContactID in the CSV file containing information about the contact, it is probably that.

    If it is, then it cannot be used as a filter in the Query for Conversation Details.


    ConcordAbush | 2020-07-27 15:43:59 UTC | #9

    Jerome.Saint-Marc, post:8, topic:8380
    ue that corresponds to the ID of a contact stored in an external system, and which is part of the calling list? When you import a CallingList, it is possible to add a set of custom columns/attributes? If you see a field for ContactID in the CSV file containing information about the contact, it is probably that.

    If it is, then it cannot be used as a filter in the Query for Conversation Details.

    I had a feeling that was the case and it seems to only associate with the calling list contact and is autogenerated per contact when it uploads but as far as I can tell does not associate with the ExternalContactID.

    Thank you so much for your help on this issue.


    system | 2020-08-27 15:44:01 UTC | #10

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