Team Channel Chat Messages

Overview

Using the Team Channel Chat Messages endpoint you are able to send chat messages to your Team's channels

Add a Channel Message

PUT /channels/{channel_id}/chat_messages

Path Parameters

Parameter

Description

channel_id

Id of the channel you are adding a message to.

Body Parameters

Parameter

Required

Default

Description

user_id

No

The id of the user that you wish to attribute the message to. The user must be a member of the given channel. If not provided the message will be attributed to the "System User"

content

No

The content of the message that you would like to create.

parent_id

No

If you would like the message to appear as a comment to a previously

created message you can provide the id of that message.

terse_push_notification

No

false

When this is false the associated push notification message will include the name of the channel and the name of the user who sent the message along with the message body. When this is set to true the push notification will simply contain the body of the message.

notification_image_url

No

If you provide a valid URL to an image it will be rendered in iOS watch notifications. NOTE: only .png, .jpg and .gif images are supported. URL must also be secure (beginning with https://). Max file size is 10MB. Smaller image will appear faster.

notification_image_type

Only if notification_image_url is used

Type of image represented by the notification_image_url. Only png, jpg and gif are supported.

Example Request Body

{
    "user_id" : "5b225b52-7a5f-4cf2-8869-fb97266e0ce8",
    "content" : "Hello ĀLO"
}

Success Response

A successful channel chat message add response will have an HTTP status of 200. The payload of the response will contain the id of the message that was created.

Error Response

If there was a problem creating the message you will receive a response that contains status and message properties.

Example error response:

{
    "status": 422,
    "message": {
        "error": "Invalid Channel User",
        "invalid_user_id": "bogus-id"
    }
}

Last updated