队列发送消息接口
POST
/api/v2/message/sendByQueue
📌
imContactId 是v1版本api接口中contact的wxid, 详见contactWxid
imRoomId 是v1版本api接口中room的wxid, 详见roomWxid
imContactId 和 imRoomId 必须存在一个,当同时存在时,优先imContactId
请求参数
Query 参数
token
string
可选
示例值:
{{org_token}}
Body 参数application/json
externalRequestId
string
会在回调中原样带回的字段,需要保证唯一(当不唯一时报错),两月内幂等
imBotId
string
托管账号对应成员的系统wxid
imContactId
string
客户的系统wxid
imRoomId
string
群聊的系统wxid
messageType
enum<number>
消息的payload
枚举值:
1256789121314
isAnnouncement
boolean
是否群公告
isAtAll
boolean
是否艾特所有人
payload
消息内容
Any of
name
string
文件名
url
string
文件地址
size
number
文件大小
示例
{
// "externalRequestId": "100",
"imBotId": "1688854807513525",
"imContactId": "7881301204958266",
"messageType": 7,
"payload": {
"text": "nihao"
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request POST '/api/v2/message/sendByQueue?token={{org_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
// "externalRequestId": "100",
"imBotId": "1688854807513525",
"imContactId": "7881301204958266",
"messageType": 7,
"payload": {
"text": "nihao"
}
}'
返回响应
🟢200成功
application/json
Body
errcode
enum<number>
返回码
枚举值:
-1-2-3-4-5-6
errmsg
string
对返回码的文本描述内容
requestId
string
消息的请求id,可与回调结合使用获取本次发消息情况
示例
{
"errcode": -1,
"errmsg": "string",
"requestId": "string"
}
修改于 2024-09-25 09:57:35