End a conversation in Direct Line API 3.0

APPLIES TO: SDK v3

The endOfConversation activity means the channel or bot has ended the conversation.

Note

While the endOfConversation event is only sent by very few channels, the Cortana channel is the only one that accepts it. Other channels, including Direct Line, do not 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"
}

Additional resources