Send a message to a UserChat

Send a new message to a chat via bot

Parameter

Accessible via URL https://api.channel.io/open/v4/user-chats/{userChatId}/messages and HTTP POST

📘

Present message parameters in POST body. This method does currently accept application/json only.

Parameter

Example

Required

Description

Parameter type

userChatId

5e65fa8bc2409f0c1fd3

Required

ID of UserChat

Path

botName

Channel-bot

Optional

Name of Bot

Query

Example

POST https://api.channel.io/open/v4/user-chats/5e65fa8bc2409f0c1fd3/messages?botName=channelBot

Request

Your POST body should look like below

{
  "requestId": "string",
  "blocks": [
    {
      "type": "bullets",
      "language": "string",
      "value": "string",
      "blocks": [
        null
      ]
    }
  ],
  "plainText": "string",
  "buttons": [
    {
      "title": "string",
      "colorVariant": "cobalt",
      "url": "string"
    }
  ],
  "files": [
    {
      "id": "string",
      "type": "string",
      "name": "string",
      "size": 0,
      "contentType": "string",
      "duration": 0,
      "width": 0,
      "height": 0,
      "orientation": 0,
      "animated": true,
      "bucket": "string",
      "key": "string",
      "previewKey": "string",
      "channelId": "string",
      "chatType": "string",
      "chatId": "string"
    }
  ],
  "webPage": {
    "id": "string",
    "url": "string",
    "title": "string",
    "description": "string",
    "imageUrl": "string",
    "videoUrl": "string",
    "publisher": "string",
    "author": "string",
    "width": 0,
    "height": 0,
    "bucket": "string",
    "previewKey": "string",
    "logo": "string",
    "name": "string"
  },
  "log": {
    "action": "changeName",
    "values": [
      "string"
    ],
    "triggerType": "string",
    "triggerId": "string"
  },
  "options": [
    "actAsManager"
  ],
  "marketing": {
    "type": "string",
    "id": "string",
    "advertising": true,
    "exposureType": "fullScreen"
  },
  "supportBot": {
    "id": "string",
    "revisionId": "string",
    "sectionId": "string",
    "stepIndex": 0,
    "buttons": [
      {
        "text": "string",
        "nextSectionId": "string"
      }
    ],
    "submitButtonIndex": 0
  },
  "threadMsg": true,
  "broadcastedMsg": true,
  "rootMessageId": "string"
}

Response

Return a newly created message object.

{
  "message": {
    "chatKey": "string",
    "id": "string",
    "mainKey": "string",
    "threadKey": "string",
    "root": true,
    "channelId": "string",
    "chatType": "string",
    "chatId": "string",
    "personType": "string",
    "personId": "string",
    "requestId": "string",
    "language": "string",
    "createdAt": 1624414655810,
    "version": 0,
    "blocks": [
      {
        "type": "bullets",
        "language": "string",
        "value": "string",
        "blocks": [
          null
        ]
      }
    ],
    "plainText": "string",
    "updatedAt": 1624414655811,
    "buttons": [
      {
        "title": "string",
        "colorVariant": "cobalt",
        "url": "string"
      }
    ],
    "files": [
      {
        "id": "string",
        "type": "string",
        "name": "string",
        "size": 0,
        "contentType": "string",
        "duration": 0,
        "width": 0,
        "height": 0,
        "orientation": 0,
        "animated": true,
        "bucket": "string",
        "key": "string",
        "previewKey": "string",
        "channelId": "string",
        "chatType": "string",
        "chatId": "string"
      }
    ],
    "webPage": {
      "id": "string",
      "url": "string",
      "title": "string",
      "description": "string",
      "imageUrl": "string",
      "videoUrl": "string",
      "publisher": "string",
      "author": "string",
      "width": 0,
      "height": 0,
      "bucket": "string",
      "previewKey": "string",
      "logo": "string",
      "name": "string"
    },
    "log": {
      "action": "changeName",
      "values": [
        "string"
      ],
      "triggerType": "string",
      "triggerId": "string"
    },
    "reactions": [
      {
        "emojiName": "string",
        "personKeys": [
          "string"
        ]
      }
    ],
    "profileBot": [
      {
        "id": "string",
        "key": "string",
        "type": "string",
        "name": "string",
        "value": {
          "s": "string",
          "n": "string",
          "b": {
            "short": 0,
            "char": "string",
            "int": 0,
            "long": 0,
            "float": 0,
            "double": 0,
            "direct": true,
            "readOnly": true
          },
          "m": {},
          "l": [
            null
          ],
          "ss": [
            "string"
          ],
          "ns": [
            "string"
          ],
          "bs": [
            {
              "short": 0,
              "char": "string",
              "int": 0,
              "long": 0,
              "float": 0,
              "double": 0,
              "direct": true,
              "readOnly": true
            }
          ],
          "null": true,
          "bool": true
        }
      }
    ],
    "state": "sending",
    "options": [
      "actAsManager"
    ],
    "marketing": {
      "type": "string",
      "id": "string",
      "advertising": true,
      "exposureType": "fullScreen"
    },
    "supportBot": {
      "id": "string",
      "revisionId": "string",
      "sectionId": "string",
      "stepIndex": 0,
      "buttons": [
        {
          "text": "string",
          "nextSectionId": "string"
        }
      ],
      "submitButtonIndex": 0
    },
    "threadMsg": true,
    "broadcastedMsg": true,
    "rootMessageId": "string"
  }
}