Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Associate external contact to conversation

    Posted 14 days ago

    Hi community,

    I'm using the endpoint /api/v2/externalcontacts/conversations/{conversationId} to associate an external contact to the conversation but testing this it looks that it doesn't verify if the conversation ID or communication ID exists, only if the inputs are not empty.

    This is important to guarantee that the association was sucessful, otherwise we receive a 202 accepted and the external contact was not registered to that interaction.

    Any ideia how to check the real OK of this?

    Thanks in advanced.

    Best regards,


    #API/Integrations

    ------------------------------
    Nuno Paulo
    ------------------------------


  • 2.  RE: Associate external contact to conversation

    Posted 14 days ago

    Hello Nuno,

    Looking at the API Explorer, I can see that the responses for that call are either 400/500 error responses, or the 202 - Accepted - Processing association response that you received.

    I have moved your question to the Genesys Cloud - Developer Community. Hopefully one of the experts there will be able to assist you with this.



    ------------------------------
    Jason Kleitz
    Online Community Manager/Moderator
    ------------------------------



  • 3.  RE: Associate external contact to conversation

    Posted 14 days ago

    Hello Nuno,

    The API actually returns an empty 202 response, but there is a way to confirm whether the interaction is being attached to an external contact.

    You can validate this directly inside the external contact profile where the interaction history is displayed.

    I just performed this test using this API inside a flow, and we can see that the interaction has been successfully attached here. By clicking the date, it opens the interaction details.



    ------------------------------
    Gabriel Garcia
    NA
    ------------------------------



  • 4.  RE: Associate external contact to conversation

    Posted 13 days ago

    Hi Gabriel,

    Thanks for your time. Yes, i checked that but it's a manual check (good for tests :) )

    The goal here is to automize that to increase the agent productivity. And we´ve this in some workflows that is not doing by an agent that can check.

    Context here:

    The flow identifies the end customer through web services and associates the external contact to the interaction but when arrives to the agent, agent checks the external contact was identified wrongly and search another end customer through agent's script and selects a new one, when click to associate a new one thinks that all good.

    And here in the last step we should check automatically if it really ok or not.

    Hope this clarifies the needs.

    Thanks in advanced.



    ------------------------------
    Nuno Paulo
    ------------------------------



  • 5.  RE: Associate external contact to conversation

    Posted 13 days ago

    Hi Nuno Paulo,

    From what I understood of your goal, you can build a flow like this:

    1. Search for the external contact using GET /api/v2/externalcontacts/contacts?q={search}.

    2. If it returns a match, get the full contact details with GET /api/v2/externalcontacts/contacts/{contactId}; if not, create a new one with POST /api/v2/externalcontacts/contacts.

    3. Retrieve the participants and communication IDs of the interaction using GET /api/v2/conversations/{conversationId}.

    4. Finally, use PUT /api/v2/externalcontacts/conversations/{conversationId} to associate the external contact with the conversation.

    I hope this helps.



    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------



  • 6.  RE: Associate external contact to conversation

    Posted 13 days ago

    Hi Luiz,

    You understood well and what you described is exactly what i'm doing.

    The difficulty here is on step 5 that should check the correct association because sometimes the endpoint returns 202 processing but not process the request and the association of that conversation doesn't execute to that external contact.

    Best regards,



    ------------------------------
    Nuno Paulo
    ------------------------------



  • 7.  RE: Associate external contact to conversation
    Best Answer

    Posted 13 days ago

    Hi Nuno Paulo,

    You are right, step 5 is the critical part.

    To validate whether the association was actually processed, you can use the Analytics Conversation Details API:

    POST /api/v2/analytics/conversations/details/query

    Example BODY:

    {
      "interval": "2025-10-08T03:00:00.000Z/2025-11-08T02:59:59.999Z",
      "paging": {
        "pageSize": 25,
        "pageNumber": 1
      },
      "segmentFilters": [
        {
          "type": "or",
          "predicates": [
            {
              "dimension": "canonicalExternalContactId",
              "operator": "matches",
              "value": "ba716735-0f90-45c8-afb1-667fb161c644"
            }
          ]
        }
      ],
      "order": "desc",
      "orderBy": "segmentEnd"
    }

    The canonicalExternalContactId should be the same ID returned by the APIs when you create or update the external contact.

    If the 202 response was actually processed, you will see the conversations correctly associated to this contact in the query result.

    If the request returned 202 but the association was not applied, those conversations will not appear for that canonicalExternalContactId, which confirms the inconsistency on processing side.



    ------------------------------
    Luiz Rosa
    Full stack developer
    ------------------------------



  • 8.  RE: Associate external contact to conversation

    Posted 10 days ago

    Hi Luiz,

    Thanks for you time.

    I tried to avoid that solution but i'm seeing that it's the only option.

    Thanks one more time.

    Best regards,



    ------------------------------
    Nuno Paulo
    ------------------------------