用户信息相关回调
更新时间: 2024/07/17 17:57:35
用户资料变更回调
HTTP示例:
httpPOST /receiveMsg.action HTTP/1.1
Host: yunxinservice.com.cn
AppKey: 1589838**194d219453d6542
CurTime: 1541583920979
MD5: e89c284a5ad9a76b3176e23108920f81
CheckSum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1
Content-Type: application/json
Cache-Control: no-cache
{"account":"yx0002","birth":"2009-11-30","clientType":"PC","deviceId":"4f716737-75dd-41cb-bc6c-d9516ff03f707bd899c82e64bdc8a5220c07c744","email":"555555@163.com","eventType":3,"ex":"","gender":1,"icon":"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1552461348&di=536bb9721d145a07657df45a8da49321&src=http://img0.pconline.com.cn/pconline/1511/29/7257120_901_thumb.jpg","mobile":"18888888888","name":"0002","sign":"这是签名","timestamp":"1552461406587"}
cURL示例:
curlcurl -X POST \
http://yunxinservice.com.cn/receiveMsg.action \
-H 'appkey: 15898**52194d219453d6542' \
-H 'cache-control: no-cache' \
-H 'checksum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1' \
-H 'content-type: application/json' \
-H 'curtime: 1541583920979' \
-H 'md5: e89c284a5ad9a76b3176e23108920f81' \
-d '{"account":"yx0002","birth":"2009-11-30","clientType":"PC","deviceId":"4f716737-75dd-41cb-bc6c-d9516ff03f707bd899c82e64bdc8a5220c07c744","email":"555555@163.com","eventType":3,"ex":"","gender":1,"icon":"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1552461348&di=536bb9721d145a07657df45a8da49321&src=http://img0.pconline.com.cn/pconline/1511/29/7257120_901_thumb.jpg","mobile":"18888888888","name":"0002","sign":"这是签名","timestamp":"1552461406587"}'
消息体中的JSON字段说明:
- 回调消息中并不是每个字段都会一定抄送,请注意对各字段的判空处理。
- 只抄送用户资料变更的字段。
名称 | 类型 | 必须 | 说明 |
---|---|---|---|
eventType | Integer | 是 | 值为3,表示是用户资料变更回调 |
account | String | 是 | 用户账号 |
deviceId | String | 是 | 发送方设备id |
clientType | String | 是 | 发送客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST |
name | String | 否 | 昵称 |
icon | String | 否 | 头像图标 |
sign | String | 否 | 签名 |
String | 否 | ||
birth | String | 否 | 生日 |
mobile | String | 否 | 手机号 |
gender | Integer | 否 | 用户性别,0表示未知,1表示男,2表示女 |
ex | String | 否 | 用户名片扩展字段 |
timestamp | String | 是 | 操作时间,字符串类型 |
好友关系变更回调
HTTP示例:
httpPOST /receiveMsg.action HTTP/1.1
Host: yunxinservice.com.cn
AppKey: 158983**d219453d6542
CurTime: 1541583920979
MD5: e89c284a5ad9a76b3176e23108920f81
CheckSum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1
Content-Type: application/json
Cache-Control: no-cache
{"eventType":4,"fromAccount":"yx0001","fromClientType":"PC","fromDeviceId":"dd950b87-3c23-4c6d-863e-4c1fdeec1ecde54f68c09b22c55214cff7618ac5","msg":"加我加我","timestamp":"1552461598694","toAccount":"yx0002","verifyType":1}
cURL示例:
curlcurl -X POST \
http://yunxinservice.com.cn/receiveMsg.action \
-H 'appkey: 1589838**194d219453d6542' \
-H 'cache-control: no-cache' \
-H 'checksum: 6f08c5ee2dd16a5fc34a12005e5d5f1411e657a1' \
-H 'content-type: application/json' \
-H 'curtime: 1541583920979' \
-H 'md5: e89c284a5ad9a76b3176e23108920f81' \
-d '{"eventType":4,"fromAccount":"yx0001","fromClientType":"PC","fromDeviceId":"dd950b87-3c23-4c6d-863e-4c1fdeec1ecde54f68c09b22c55214cff7618ac5","msg":"加我加我","timestamp":"1552461598694","toAccount":"yx0002","verifyType":1}'
消息体中的JSON字段说明:
- 回调消息中并不是每个字段都会一定抄送,请注意对各字段的判空处理。
- 注意区分添加好友和删除好友抄送的字段有所不同。
名称 | 类型 | 必须 | 说明 |
---|---|---|---|
eventType | Integer | 是 | 值为4,表示是添加好友回调; 值为5,表示是删除好友回调 |
fromAccount | String | 是 | 发起者账号 |
toAccount | String | 是 | 接收者账号 |
fromDeviceId | String | 是 | 发送方设备id |
fromClientType | String | 是 | 发送客户端类型: AOS、IOS、PC、WINPHONE、WEB、REST |
verifyType | Integer | 否 | 添加好友时此字段必有;含义:1直接加好友,2请求加好友,3同意加好友,4拒绝加好友 |
msg | String | 否 | 添加好友时此字段有效;含义:加好友对应的请求信息 |
timestamp | String | 是 | 操作时间,字符串类型 |
此文档是否对你有帮助?