差别
这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 后一修订版 两侧同时换到之后的修订记录 | ||
im:server:ready:user [2019/03/11 04:08] she |
im:server:ready:user [2019/03/11 11:53] she |
||
---|---|---|---|
行 169: | 行 169: | ||
<code php> | <code php> | ||
- | curl -X POST -i "https://a1.easemob.com/easemob-demo/testapp/users" -d '{"username":"user1","password":"123",“nickname”:”testuser”}' | + | curl -X POST -i "https://a1.easemob.com/easemob-demo/testapp/users" -d '{"username":"user1","password":"123","nickname":"testuser"}' |
</code> | </code> | ||
行 1712: | 行 1712: | ||
<code php> | <code php> | ||
- | curl -X GET -H | + | curl -X POST http://a1.easemob.com/easemob-demo/chatdemoui/users/batch/status -H 'Authorization: Bearer YWMte3bGuOukEeiTkNP4grL7iwAAAAAAAAAAAAAAAAAAAAGL4CTw6XgR6LaXXVmNX4QCAgMAAAFnKdc-ZgBPGgBFTrLhhyK8woMEI005emtrLJFJV6aoxsZSioSIZkr5kw' -H 'Content-Type: application/json' -d '{"usernames":[“user1”,“user2”]}' |
</code> | </code> | ||
行 1719: | 行 1719: | ||
**返回值200,表示查询用户状态成功** | **返回值200,表示查询用户状态成功** | ||
+ | 如果请求输入错误的用户名,即请求不存在的用户状态,则返回的参数一定是offline,此接口不对用户名进行校验。 | ||
<code json> | <code json> | ||
{ | { | ||
- | "action": "get", | + | "action": "get batch user status", |
- | "uri": "http://a1.easemob.com/easemob-demo/testapp/users/user1/status", | + | "data": [ |
- | "entities": [], | + | { |
- | "data": { | + | "user1": "offline" |
- | "user1": "offline" | + | }, |
- | }, | + | { |
- | "timestamp": 1542601284531, | + | "user2": "offline" |
- | "duration": 4, | + | } |
- | "count": 0 | + | ], |
- | } | + | "timestamp": 1552280231926, |
- | </code> | + | "duration": 4 |
- | + | ||
- | **返回值404,表示此IM用户不存在** | + | |
- | <code json> | + | |
- | { | + | |
- | "error": "service_resource_not_found", | + | |
- | "timestamp": 1542601345042, | + | |
- | "duration": 0, | + | |
- | "exception": "org.apache.usergrid.services.exceptions.ServiceResourceNotFoundException", | + | |
- | "error_description": "Service resource not found" | + | |
} | } | ||
</code> | </code> | ||
行 1757: | 行 1749: | ||
如果返回结果是<wrap em>429、503</wrap>或者其他<wrap em>5xx</wrap>,有可能代表该接口被限流了,请稍微暂停一下并重试;或者或者请求的用户数大于100,请重新发送正确数量的请求。详见[[im:server:help:restastrict|接口限流说明]] | 如果返回结果是<wrap em>429、503</wrap>或者其他<wrap em>5xx</wrap>,有可能代表该接口被限流了,请稍微暂停一下并重试;或者或者请求的用户数大于100,请重新发送正确数量的请求。详见[[im:server:help:restastrict|接口限流说明]] | ||
- | [[http://api-docs.easemob.com/|使用 Easemob REST API 在线测试]] | ||
- | --- | + | ---- |
==== 获取用户离线消息数 ==== | ==== 获取用户离线消息数 ==== |