- 开发指南
- 基础API
- 登录模块
- 联系人模块
- 群模块
- 消息模块
- 朋友圈模块
- 标签模块
- 个人模块
- 收藏夹模块
- 视频号模块
- 账号管理
- 更多信息
发送语音消息
POST
/gewe/v2/api/message/postVoice
请求参数
Header 参数
X-GEWE-TOKEN
string
必需
示例值:
{{gewe-token}}
Body 参数application/json
appId
string
设备ID
toWxid
string
好友/群的ID
voiceUrl
string
必需
voiceDuration
integer
语音时长,单位毫秒
示例
{
"appId": "{{appid}}",
"toWxid": "34757816141@chatroom",
"voiceUrl": "https://scrm-1308498490.cos.ap-shanghai.myqcloud.com/1/silkFile.silk?q-sign-algorithm=sha1&q-ak=AKIDmOkqfDUUDfqjMincBSSAbleGaeQv96mB&q-sign-time=1724227312;2588140912&q-key-time=1724227312;2588140912&q-header-list=&q-url-param-list=&q-signature=7c603355032a67280328c9b898b9e04bdd56e79b",
"voiceDuration": 2000
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://api.geweapi.com/gewe/v2/api/message/postVoice' \
--header 'X-GEWE-TOKEN: ' \
--header 'Content-Type: application/json' \
--data-raw '{
"appId": "",
"toWxid": "34757816141@chatroom",
"voiceUrl": "https://scrm-1308498490.cos.ap-shanghai.myqcloud.com/1/silkFile.silk?q-sign-algorithm=sha1&q-ak=AKIDmOkqfDUUDfqjMincBSSAbleGaeQv96mB&q-sign-time=1724227312;2588140912&q-key-time=1724227312;2588140912&q-header-list=&q-url-param-list=&q-signature=7c603355032a67280328c9b898b9e04bdd56e79b",
"voiceDuration": 2000
}'
返回响应
🟢200成功
application/json
Body
ret
integer
必需
msg
string
必需
data
object
必需
toWxid
string
接收人的wxid
createTime
integer
发送时间
msgId
integer
消息ID
newMsgId
integer
消息ID
type
integer
消息类型
示例
{
"ret": 200,
"msg": "操作成功",
"data": {
"toWxid": "34757816141@chatroom",
"createTime": 1704357563,
"msgId": 640355967,
"newMsgId": 2321462558768366600,
"type": null
}
}
修改于 2024-08-21 08:02:22