Overview
Sends a message from an Official Account.
Request
Authentication Add authentication headers to the request. See Authentication
Method
POST
Rate limit
100 requests/second
Endpoint https://API domain/apigateway/messages/publicchannel/send
Content-Type
application/json
Request Parameters
| Parameter | Data Type | Required | Description | |
|---|---|---|---|---|
sender_id | string | Yes | Sender ID. Maximum length: 32 characters. | |
target_ids | array | Yes | Official Account IDs. Each ID can contain up to 32 characters. | |
msg_type | string | Yes | Message type identifier. Maximum length: 50 characters. | |
msg_content | string | Yes | Message content. JSON is recommended. | |
| push_data.push_text | string | No | Push-notification text. | |
| push_data.push_extra | string | No | Custom push-notification data. A JSON string is recommended. | |
| push_data.push_level | number | No | Push priority: 0 default; 1 ignores push rate limiting; 2 ignores Mute Notifications. | |
is_storage | bool | No | Whether to store the message in message history. Default: true. | |
is_count | bool | No | Whether to include the message in the unread count. Default: true. |
Request Example
POST /apigateway/messages/publicchannel/send HTTP/1.1
appkey: appkey
signature: 2e639ae3600a4sdff61fb88b76f485b
nonce: nonce
timestamp: 1672568121910
Content-Type: application/json
{
"sender_id":"userid1",
"target_ids":["channel1"],
"msg_type":"text",
"msg_content":"{\"content\":\"aabbcc\"}"
}
Response Parameters
| Parameter | Data Type | Description | |
|---|---|---|---|
| data | array | Message delivery results. | |
| data[].target_id | string | Official Account ID. | |
| data[].msg_id | string | Unique message identifier. |
Response Example
{
"code":0,
"msg":"sucess",
"data":[
{
"target_id":"channel1",
"msg_id":"aaaaaaa"
}
]
}