发送私聊信息
POST http://{rest-host}/im/v1/private_message
参数 | 类型 | 必须 | 描述 |
---|---|---|---|
rest-host | String | 是 | 根据您创建应用的区域选择 杭州:rest-hangzhou.goeasy.io 新加坡:暂不支持,敬请期待 |
appkey | String | 是 | common key 或者 rest key |
senderId | String | 是 | 发送方的userId |
receiverId | String | 是 | 接收方userId |
payload | String | 是 | 消息内容,最长不超过3K,可以是任何格式的字符串,比如:JSON或者XML格式 |
curl -X POST -H "Content-Type: application/json"
http://rest-hangzhou.goeasy.io/im/v1/private_message
-d '{
"appkey":"BC-xxxxx",
"senderId":"user1",
"receiverId":"user2",
"payload":"{\"title\":\"example Message\",\"content\":\"Hello GoEasy!\"}"
}'
{
"code": 200,
"content": "ok"
}
{
"code":401,
"content":"Unauthorized"
}