Instant Messaging
Server
Getting Started
Limits
Platform Service
Webhooks
Overview
Message-related Callback
Related Callbacks of User Information
Related Callbacks of Advanced Team
Related Callbacks of Super Team
Related Callbacks of Audio and Video
Callback related to Log in
Data Sync
Data Sync Overview
Activate Data Sync
IM Session Message Delivery
Other IM Message Delivery
Audio/video/whiteboard Duration Message Delivery
Content Moderation
Overview
Best Practice
API Reference
Overview
Status Code
Account Management
Register Accounts
Refresh Token
Ban Accounts
Mute Accounts
Push Notification
Login Authentication
Messaging
Send Messages
Unsend Messages
Send Broadcast Messages
Upload Files
Delete a message
Delete a roaming message
Message history
History
Custom system notification
User Profile
User Relationship
Host User Relationship
Group
Advanced group
Supergroup
Chat room
Create a chat room
Get the URL of a chat room
Update chat room info
Edit chat room states
Set a timer to close a chat room
Manage roles
Get the member list
Manage chatbots
Manage tags
Message queues
Online Status

User Profile

Update time: 2021/12/03 18:20:51

Updating user profiles

Request URL

POST 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

ParameterTypeRequiredDescription
accidStringYesUser account, with a maximum length of 32 characters, must be unique within one APP
nameStringNoUser profile name, with a maximum length of 64 characters, can be set as an empty string
iconStringNoUser profile picture, with a maximum length of 1024 characters, can be set as an empty string
signStringNoUser signature, with a maximum length of 256 characters, can be set as an empty string
emailStringNoUser email, with a maximum length of 64 characters, can be set as an empty string
birthStringNoUser birthday, with a maximum length of 16 characters, can be set as an empty string
mobileStringNoUser 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
genderintNoUser gender, 0-unknown, 1-male, 2-female, other figures would result in parameter error
exStringNoUser 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

curl -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.

"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

POST 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

ParameterTypeRequiredDescription
accidsStringYesUser 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

curl -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.

"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 .

Was this topic helpful?
Yes
No
  • Updating user profiles
  • Request URL
  • Parameters
  • curl request example
  • Response
  • Valid status codes
  • Get user profile
  • Request URL
  • Parameters
  • curl request example
  • Response
  • Valid status codes