getting visitor info on chat

Answered

9 Comments

  • Bryan - Community Manager
    Comment actions Permalink

    Hi Evan,

    The Chat Conversations API is effectively an agent. Since it is run from a backend service, that backend service could call other APIs (such as the Zendesk Chat API or Zendesk Support API) to look up and return information.

    You can use the zE('webWidget', 'identify', data<object>); widget API to set the end user's information, which would carry into the Chat Conversations API session.

    Your backend service would need to authenticate into whatever APIs it needs to access and make sure whatever they're returning belongs to the end user that was identified. So I think what you're after is possible. Hope this is enough to get you going and helps!

    0
  • Evan Tann
    Comment actions Permalink

    Thanks for answering! I have another question on Conversation API: if I run more than 1 websocket clients (with different subscription IDs I guess) on a single account, do they all get notified for the same incoming messages? Or does API notify only one client? If all get notified, will they all see the same message ID?

    Thanks!

    0
  • Evan Tann
    Comment actions Permalink

    Actually it looks like Conversation API does not allow more than 1 concurrent connections in the first place. I get EOS error with "unexpected session state" message in all connections except for 1. Does that mean, we will have to create multiple access tokens (via OAuth2) if we want to create multiple connections to the API? 

    0
  • Jay
    Comment actions Permalink

    Hi Evan,

    > Conversation API does not allow more than 1 concurrent connections in the first place.

    yes, if you call `startAgentSession`, a different websocket url is obtained each time. Connecting to the URL would start agent session and Chat Conversations API only allows maximum one agent session.

    > Does that mean, we will have to create multiple access tokens (via OAuth2) if we want to create multiple connections to the API

    It would not work as all access tokens created via OAuth2 belongs to the same agent.

    The quick workaround is to have two agents connected to chatConversation API and both could have a different session.

    We would be interested to understand your use case for multiple connections to the API.

    Regards,
    Jay

    0
  • jackson
    Comment actions Permalink

    Hi, I called zE.identify to set the end user's information, but I want to clear the user's information when I log out again. What should I do? Have a good day.

    0
  • Joey
    Comment actions Permalink

    Hi Jackson-
    You should be able to clear form fields or reset to clear fields and reset the widget to its original state.

    0
  • jackson
    Comment actions Permalink
     
    Hi Joseph May-
    Thanks for your answer, I cleared the user information with clear, but I also want to clear the chat history. What should I do? Have a good day.
    0
  • jackson
    Comment actions Permalink

    I still have a problem. I want users who have set up information using zE.identify to get the previous chat history when chatting with the customer service. What should I do?Have a good day.

    0
  • Joey
    Comment actions Permalink

    Hi Jackson-

    The option to fetch chat history is only available for visitors who have authenticated by JWT. As far as clearing the history, I am not aware of any way to do so.

    0

Please sign in to leave a comment.

Powered by Zendesk