Messaging

Send Bot Message

POST https://api.talkplus.io/v1.4/api/bots/:botId/channels/:channelId/send

  • The following message types are supported: bot and bot_hidden.

  • Push notification is not sent for bot_hidden message type.

  • You can enter up to 10 key-value pairs in data field. The maximum size of key is 128 characters and the maximum size of value is 1024 characters. Both key and value must be strings.

  • Both message text and data cannot be empty when sending a message.

  • The maximum allowed length of message text is 8192 characters.

Headers

Name
Type
Description

content-type

string

application/json

app-id*

string

App ID

api-key*

string

App API key

Request Body

Name
Type
Description

type*

string

message type (must be "bot" or "bot_hidden")

text

string

data

object

custom metadata

type

string

user-defined value (max char length: 68)

fileUrl

string

{
  "message": {
    "id": "sdf2l5s9j",
    "channelId": "channel123",
    "userId": "bot_001",
    "username": "bot_name",
    "profileImageUrl": "http://cdn.test.com/456.jpg",
    "type": "bot",
    "text": "Hello world",
    "data": {
      "customField": "customData"
    },
    "parentMessage": {},
    "translations": {},
    "reactions": {},
    "fileUrl": "http://cdn.test.com/123.jpg",
    "mentions": [],
    "createdAt": 1583921400
  }
}

Last updated