ForumCategory: BotsWhen I close a conversation by Messaging Agent SDK, the PCS do not show up
akim asked 49 years ago

Issue: When I close a conversation by Messaging Agent SDK, the PCS do not show up.    *When I close the conversation by consumer, it works. So, I sure the setting of PCS is OK.    What I know,    We are using the multi dialog architecture for the PCS??  So, If I use the following method. It will close entire conversation??  

Start your code here           
agent.updateConversationField({
conversationId: conversationId/dialogId,
conversationField: [{
field: 'ConversationStateField',
conversationState: 'CLOSE' }]
});

   So, I was refer the following sample.   https://github.com/LivePersonInc/node-agent-sdk/tree/master/examples#survey-bot   But, I don’t know what I need to refer…  I don’t know what’s the trigger to happen the “POST_SURVEY”.. I know if I close a conversation by consumer, the event will happen.  But, I need to close the conversation by BOT agent. How can I just close the main dialog? And, trigger the post conversation survey? 

2 Answers
Mark Manguno Staff answered 1 month ago

Hi @akim 
In order to support PCS you have to change the payload of your “updateConversationField” action as follows:
Instead of:

agent.updateConversationField({
        conversationId: conversationId/dialogId,
        conversationField: [{
            field: 'ConversationStateField',
            conversationState: 'CLOSE'
        }]
    });

try

agent.updateConversationField({
            conversationId: conversationId,
            conversationField: [
                {
                    field: 'DialogChange',
                    type: 'UPDATE',
                    dialog: {
                        dialogId: dialogId,
                        state': 'CLOSE'
                    }
                }
            ]
        });
akim answered 1 month ago

Hi, Can you tell me what’s the difference between Conversation ID and Dialog ID?  I found it in the content event. But, it is same id…  When it will become differ? 

Attachments
akim replied 1 month ago

Hi, Thanks. It works for me. But I still want to know the specification of Conversation ID and Dialog ID.

I can get dialog id from two place. one is “MessagingEventNotification.body.dialogId” and another one is “MessagingEventNotification.body.changes[array].dialogId. I am using the dialogid from body. Am I right? Or, should I use the dialogId in the changes….

Mark Manguno Staff replied 4 weeks ago

<p><a href="https://support.liveperson.com/forum-2/?user=akim">@akim</a></p><p>A conversation is a container that can contain multiple dialogs. The primary dialog is the conversation between the consumer and the agent(s) that they talk to, and it has the same ID as the conversation. Another dialog might be the Post Conversation Survey, if you have that feature enabled and a survey configured for that skill.</p>

akim replied 4 weeks ago

OK. I got it. Thank you very much. Mark!