Send a message to a Group

POST message via groupId

Send a message to a Group by groupId

Parameter

Accessible via URL https://api.channel.io/open/v3/groups/{groupId}/messages and HTTP POST

📘

The POST request body should be a Message object. This method accepts application/json

Parameter

Example

Required

Description

Parameter type

groupId

1234

Required

Id of Group

Path

botName

channelBot

Required

Name of the Bot that sends the message

Query

Example

POST https://api.channel.io/open/v3/groups/1234/messages?botName=channelBot

POST message via groupName

Send a new message to Group by groupName

Parameter

Accessible via URL https://api.channel.io/open/v3/groups/@{groupName}/messages and HTTP POST

📘

The POST request body should be a Message object. This method accepts application/json

Parameter

Example

Required

Description

Parameter Type

groupName

justgroup

Required

Name of Group

Path

botName

channelBot

Required

Name of the Bot that sends the message

Query

Example

POST https://api.channel.io/open/v3/groups/@justgroup/messages?botName=channelBot

Request Body Example

Your POST request body should look like

{
  "blocks": [
    {
      "type": "text",
      "value": "This is <b>bold</b>, <i>italic</i>, and <b><i>bold+italic</i></b>. Emoji should be in shortcode :+1: :100: "
    },
    {
      "type": "text",
      "value": "<link type=\"manager\" value=\"managerId_goes_here\">@username</link>"
    },
    {
      "type": "text",
      "value": "This is a url <link type=\"url\" value=\"https://channel.io\">https://channel.io</link>"
    },
    {
      "type": "text",
      "value": "This is a link <link type=\"url\" value=\"https://channel.io\">Channel</link>"
    },
    {
      "type": "code",
      "value": "<script>ChannelIO('boot')</script>"
    },
    {
      "type": "bullets",
      "blocks": [
        {
          "type": "text",
          "value": "Bulleted text goes here"
        },
        {
          "type": "text",
          "value": "Next bulleted text goes here"
        }
      ]
    }
  ]
}

Response

Returns a newly created message object.

{
  "message": 
    {
      "chatKey": "directChat-49668",
      "id": "5e75b863df638ecff1a5",
      "channelId": "1",
      "chatType": "directChat",
      "chatId": "49668",
      "personType": "manager",
      "personId": "27960",
      "requestId": "4c568fc5-e11c-4ff6-8e41-d81e10e702c7",
      "language": "en",
      "createdAt": 1584773219915,
      "version": 1,
      "blocks": [
        {
          "type": "text",
          "value": "Hello World!"
        }
      ],
      "plainText": "Hello World!"
  }
}