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.
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.
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?
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.
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.