Inbox

Manipulate conversation

This allows you to manipulate the conversation in the same way you would when responding to a webhook request. You can send a reply, add a topic, and/or hand off the conversation. Each property in the body is optional. If you only want to send a message, you can send {"sendMessage": {"text": "Hi!"}}. If you want to apply a topic and complete, but not send a message, you can, for example, send {"applyTopics":["Spam"], "complete": "RESOLVED"}.

Note that only topics that match a topic in the platform exactly (case insensitive) will be applied to the conversation. Non-existing topics are ignored. Currently, no fuzzy matching will occur and typographical errors will result in a non-existing topic.

The same applies to tags. Only tags that match a tag in the platform exactly (case insensitive) will be applied to a specific message. Non-existing tags are ignored. You must specify the messageId when using the REST API. The messageId is part of every INBOUND_MESSAGE_RECEIVED event.

If you want to send an attachment, you must first upload the attachment in a separate call (PUT /inbox/v1/virtual-agent/conversations/{conversationId}/attachments/{filename}), and then use the file name when sending the message ({"sendMessage": {"attachment": ""}}).

If the contact already has a value saved for the attribute definition with a particular alias, the update will be ignored. If any of the attribute definitions are configured as CRM lookup values, a CRM lookup is performed after the attributes are set. For the best performance, we recommend setting contact attributes along with the response to indicate that the conversation is completed. Note that the virtual agent will not receive the new attributes from the CRM response until the next CONVERSATION_STARTED or CONVERSATION_DELEGATED event is received for a conversation with a contact.

post/inbox/v1/virtual-agent/conversations/{conversationId}

Request

  • Base URL
    https://platform.hootsuite.com
  • URL
    https://platform.hootsuite.com/inbox/v1/virtual-agent/conversations/{conversationId}
  • Auth
    OAuth 2
    Authorization code: https://platform.hootsuite.com/oauth2/auth
    Token URL: https://platform.hootsuite.com/oauth2/token

Path parameters

conversationIdstring required

Id of the conversation to manipulate. This can be retrieved from the webhook payload.

Request body

indicateTyping'START' | 'STOP'

Indicate whether you are typing

applyTopicsstring[]

The topics you want to apply to the conversation

applyTagsstring[]

The tag you want to apply to the latest message

setContactAttributesobject

The attributes you want to apply to the contact. The key should match "^[a-zA-Z0-9_]+$"

complete'HANDOVER' | 'RESOLVED'

Finish a conversation by handing it off to a human agent or by marking the conversation resolved

Example request

{
  "sendMessages": [
    {
      "text": "Hi! How can I help you?",
      "attachment": "funny_cat.gif"
    }
  ],
  "sendMessage": {
    "text": "Hi! How can I help you?",
    "attachment": "funny_cat.gif"
  },
  "applyTopics": [
    "Hotel Reservation"
  ],
  "applyTags": [
    "Happy"
  ],
  "applyConversationNotes": [
    {
      "text": "Some note to add"
    }
  ],
  "setContactAttributes": {
    "account_number": "19758293529351"
  }
}

Response

Success

object required

Changes

No recorded changes to this operation across all 1 revision of this API.