End a conversation in Direct Line API 3.0
The endOfConversation activity means the channel or bot has ended the conversation.
Note
The endOfConversation event is sent by very few channels, and few channels accept it. Some channels, including Direct Line, don't implement this functionality and instead drop or forward the activity on; each channel determines how to react to an endOfConversation activity.
Send an endOfConversation activity
To request to end a conversation with Cortana channel, POST End of Conversation Activity to the channel's messaging endpoint.
Request
POST https://directline.botframework.com/v3/directline/conversations/abc123/activities
Authorization: Bearer RCurR_XV9ZA.cwA.BKA.iaJrC8xpy8qbOF5xnR2vtCX7CZj0LdjAPGfiCpg4Fv0
[other headers]
{
"type": "endOfConversation",
"from": {
"id": "user1"
}
}
Response
If the request is successful, the response will contain an ID for the activity that was sent.
HTTP/1.1 200 OK
[other headers]
{
"id": "0004"
}