User profile
Update time: 2023/09/13 07:24:40
Updating user profiles
Request URL
httpPOST https://api.netease.im/nimserver/user/updateUinfo.action HTTP/1.1
Content-Type: application/x-www-form-urlencoded;charset=utf-8
For information about headers in the request, see Overview.
Updating the user profile will be exposed to other users in the teams and chat rooms in scenarios such as teams and chat rooms. These fields such as mobile, email, birth and gender are non-required and may involve privacy information. If these information is sensitive information to you, we recommend to fill in the relevant information using the extended field ex and encrypt in advance.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
accid | String | Yes | User account, with a maximum length of 32 characters, must be unique within one APP |
name | String | No | User profile name, with a maximum length of 64 characters, can be set as an empty string |
icon | String | No | User profile picture, with a maximum length of 1024 characters, can be set as an empty string |
sign | String | No | User signature, with a maximum length of 256 characters, can be set as an empty string |
String | No | User email, with a maximum length of 64 characters, can be set as an empty string | |
birth | String | No | User birthday, with a maximum length of 16 characters, can be set as an empty string |
mobile | String | No | User mobile, with a maximum length of 32 characters, country code (such as US code: +1-xxxxxxxxxx) or area code (such as HK area code: +852-xxxxxxxx) is required for any mobile number registered outside of Mainland China, and can be set to an empty string |
gender | int | No | User gender, 0-unknown, 1-male, 2-female, other figures would result in parameter error |
ex | String | No | User name card extension field, with a maximum length of 1024 characters, can be extended by the user, recommended to encapsulate it into a JSON string, or set it as an empty string |
curl request example
curlcurl -X POST -H "AppKey: go9dnk49bkd9jd9vmel1kglw0803mgq3" -H "Nonce: 4tgggergigwow323t23t" -H "CurTime: 1443592222" -H "CheckSum: 9e9db3b6c9abb2e1962cf3e6f7316fcc55583f86" -H "Content-Type: application/x-www-form-urlencoded" -d 'accid=zhangsan&name=Jack' 'https://api.netease.im/nimserver/user/updateUinfo.action'
Response
The data returned in the HTTP response is in JSON format.
json"Content-Type": "application/json; charset=utf-8"
{
"code":200
}
Valid status codes
200, 403, 414, 416, 431, 500
See Status codes .
Get user profile
Request URL
httpPOST https://api.netease.im/nimserver/user/getUinfos.action HTTP/1.1
Content-Type: application/x-www-form-urlencoded;charset=utf-8
For information about headers in the request, see Overview.
Get multiple user profiles at a time
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
accids | String | Yes | User account (such as: the accid string corresponding to JSONArray, including: \["zhangsan"\], any parsing error would result in code 414) (max. number for one query is 200) |
curl request example
curlcurl -X POST -H "AppKey: go9dnk49bkd9jd9vmel1kglw0803mgq3" -H "Nonce: 4tgggergigwow323t23t" -H "CurTime: 1443592222" -H "CheckSum: 9e9db3b6c9abb2e1962cf3e6f7316fcc55583f86" -H "Content-Type: application/x-www-form-urlencoded" -d 'accids=["zhangsan"]' 'https://api.netease.im/nimserver/user/getUinfos.action'
Response
The data returned in the HTTP response is in JSON format.
json"Content-Type": "application/json; charset=utf-8"
{
"code":200,
"uinfos":
[
{
"accid": "t1", //account number
"name": "Xiao Ming", //profile name
"icon": "https://nim-nosdn.netease.im/MTAxMTAwMg==/bmltYV8xMDU5Njk3XzE1NzMwMjgxNTYyMTRfNGExMmY5ZGUtMWU2Ni00ZTAwLWIyZjgtZmFiM2E0YzAxYTEw",//profile picture
"sign": "hello",//signature
"email": "t1@163.com",//email
"birth": "2015-12-23",//birthday
"mobile": "18645454545",//mobile number
"ex": "",//extension information
"gender": 1,//Gender: 0 indicates unknown, 1 indicates male, 2 mans female
"valid": true, //whether account is valid
"mute": true //whether account is muted
}
{"accid":"t2","name":"def","gender":0}
]
}
Valid status codes
200, 403, 414, 416, 431, 500
See Status codes .