Is it possibile to obtain the rate and the comment when a user leaves the chat?

3 Comments

  • Bryan - Community Manager
    Comment actions Permalink

    The Chat Conversations API is limited on these points Andrea. Only the end user can end a chat.  However, know that the chatbot service, along with servicing realtime chats, can also call the REST Chat APIs as needed — just like any other backend service could.

    0
  • Andrea Tarquini
    Comment actions Permalink

    Ok thanks Bryan. But how to obtain the ChatID from the conversation message or activity subscriptions (I'm using websocket)? 

    0
  • Bryan - Community Manager
    Comment actions Permalink

    Hi Andrea Tarquini. To be clear, while the REST Chat specific APIs can be called by the service that also hosts the Chat Conversations API service, these REST APIs only return information on chats that have already ended. IOW, the Chat Conversations service can't call a REST API on a chat that is still in progress.

    A Chat Conversations servicehowever, can get the active chat's eventual ID assigned when the chat has ended, which can later be used when calling the Chat REST APIs — it's the "raw_id" attribute. You can see what a GraphQL subscription looks like that includes it here

         this.graphQlMessage = 
    {
    id: this.id,
    type: "request",
    payload: {
    query: `subscription {
    message {
    node {
    id
    content
    channel {
    id
    ... on VisitorChannel {
    ip
    raw_id
    city
    country
    ...<snip>...

    The service could cache and later use this ID as needed. Not knowing your use case, I'm not sure if this helps you or not but hopefully is useful to know!

    1

Please sign in to leave a comment.

Powered by Zendesk