Identify contacts through web messaging

Hello everyone! I hope you are good.

I am trying to identify clients through a widget that I have displayed on a web page. On that web page I obtain the name and email of the logged in user and send it as participant data to Genesys Cloud. I would like to use this data to create a contact if it does not exist (with that email) or to identify which contact it is so that when the agent receives it he knows which client it is.

The problem is that the API
/api/v2/externalcontacts/contacts lets me create contacts without taking into account contacts already created with that information. And I did not find any API that allowed me to effectively search for a contact (for example through their email) to know if it exists or not.

Does anyone have an idea how I could proceed?

Thank you all!

Hi,

Check the following api for searching contacts:
/api/v2/externalcontacts/contacts?q=<value>

See https://developer.genesys.cloud/commdigital/externalcontacts/externalcontacts-apis#get-api-v2-externalcontacts-contacts

An interesting post on this subject with some code:

General doc:

Hope this helps,

Regards,
V.P.

1 Like

The problem is that with that API to search for contacts, you couldn't search by email, right? I would have to search for the client's name and analyze all the responses with data from clients with similar names to find if the email exists or not. I am right?

Hi @Marcelo_Casana you can search across contacts using the q query parameter, which will also search across email.
Have you seen this article? Let us know if what you're trying to achieve is not addressed by the article: https://developer.genesys.cloud/commdigital/externalcontacts/contact-merges
It sounds like you're trying to apply some logic to avoid duplication of contacts.

1 Like

Thanks Angelo, that's exactly what I was trying to do. I have advanced with the solution that has been provided to me in the documentation but I have a problem, when I have already identified the contact and obtained the contactId, when I try to associate the interaction ( PUT
/api/v2/externalcontacts/conversations/{conversationId}) with that contact I get a 202, which I understand means that it is being processed, the problem is that it never finishes processing, and I would also need this to be before the interaction reaches it to the agent, so he would view the customer's contact when the interaction arrives. Is it an API problem or am I doing something wrong?

Hi,

Could you provide a conversationId ?
We can check underlying processing.

Regards,
V.P.

Hello,

Yes, here I leave the conversationId

e6b08012-0fc4-49bb-ae69-6cd31add1906

Thank you

Hi,

I could find your conversation in server logs.
I do not see any issue in the processing itself which publish an event with contacts info.
Processing time takes around 100ms.

"Emitting event organizationId=[<obfuscated>] externalOrganizationId=[null] contactId=[1d299389-1cf4-4df1-b8ea-8ab4036f601c] conversationId=[e6b08012-0fc4-49bb-ae69-6cd31add1906] communicationId=[83f0f2ee-8897-4b2e-b7b2-e6a4e08496f7]"

This command does not return any data but associate your contact to the conversation.

What makes you thing it does not work ?

for internal reference: _code=PzaPFQ124nLitdeXaE8zRZH0zQxZtj3NR3I4tsAt

You may want to check the conversation;
/api/v2/conversations/emails/e6b08012-0fc4-49bb-ae69-6cd31add1906/messages

Hope this helps,

Regards,
V.P.

1 Like

The conversation created an ‘ephemeral’ contact as only a cookie was provided.

Claimed Identifier{organizationId:<redacted>, divisionId:null, type:cookie, label:null, sourceId:null, normalizedValue:hash: 514zjWvR2yh4VpcuPnEXbS_TtFzbXdqg7Ctu1fs5gcA, value:hash: 514zjWvR2yh4VpcuPnEXbS_TtFzbXdqg7Ctu1fs5gcA} for Contact{34d18b59-6f0d-48f7-b507-4f95d2cb3be4::null::bf09ad18-e0a5-494b-bf8f-f7c1d4767ac5::null}

Created new Contact{<orgId redacted>::null::bf09ad18-e0a5-494b-bf8f-f7c1d4767ac5::ephemeral}"

The contactId has been associated to the conversation.

At that point, you can use the contactId to update it and add an email or other info. Once updated the contact will be of type ‘curated’ and will be searchable by its attributes. Another way to find the contact is to use identifierlookup with Cookie type and provide the cookie value, this will return the contactId.

Api

Hope this helps,

Regards,
V.P.

1 Like

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