Comments, Tags and Search

Comments (mentions)

A Comment is a mention typed message that is not sent to the consumer, but serves as a comment to the organization owning the conversation, one of the ancestor organizations, or one of the agents. A mention must have the ID of the targeted user or organization as its meta.targetUser or meta.targetOrganization property. The text may be optionally prepended with the at-sign followed by the displayName (or name, when the target does not have a displayName) of the target.

To send a comment to a specific user

Request: POST /v2/conversations/590bd49f458b716046347f47/messages

{
    "type": "mention",
    "text": "@Developer Developer Nice weather :thumbsup:",
    "meta": {
        "targetUser": "591789e5c63934459825dede"
    }
}

This has the inbox flag set for the targeted participant, and notifies the target user (if logged in). context

To send a comment to a specific organization, use:

Request: POST /v2/conversations/590bd49f458b716046347f47/messages

{
    "type": "mention",
    "text": "@Acme Demo You are the best",
    "meta": {
        "targetOrganization": "5c8599bd56f730752e926dc6"
    }
}

This will route the message by running the target organization's routing rules, effectively processing the mention the same way as an inbound consumer message.

In both cases, the '@' part of the text may be stripped if it matches the target user's name, and the system will set the targeted user or organization name as meta.targetName The resulting message would look like this:

Request: GET /v2/messages/5c85aa6256f730752e926dcc

{
    "type": "mention",
    "text": "You are the best",
    "meta": {
        "targetOrganization": "5c8599bd56f730752e926dc6",
        "targetName": "Acme Demo"
    }
}

In the UI this messages will be shown like this: context

Tags

Using Tags an agent can specify keywords relevant to the conversation.

Request: POST /v2/conversations/590bd49f458b716046347f47/messages

{
    "type": "tag",
    "text": "#hashTag, hash !! tag#tag; #hash"
}

Response: 201 Created

In the UI shown as three separate tags. context

{
    "id": "593466e4e9338706663c1973"
    "organization": "590bcf50458b716046347f36",
    "conversation": "590bd49f458b716046347f47",
    "type": "tag",
    "text": "hashTag hash tagtag",
    "actions": [],
    "results": [],
    "updatedAt": "2017-06-04T20:00:36.284Z",
    "createdAt": "2017-06-04T20:00:36.284Z"

}

As you can see, the pound-sign as well as any other punctuation mark is removed and duplicates filtered, leaving just a string of words separated by a whitespace.

Search is a special command-like type that may be picked up by automations to provide search results.

Request: POST /v2/conversations/590bd49f458b716046347f47/messages

{
    "type": "search",
    "text": "audi a5"
}