Browse Platform API
Platform API

Overview

Copy

The user module maps accounts in your business system to OpenIM users and manages profiles, queries, presence, and notification accounts from trusted backend services. Keep the administrator token on the backend; browser, mobile, and desktop clients must not call these management endpoints directly.

Capability scope

CapabilityDescription
User creationRegister a business user ID in OpenIM with a nickname, avatar, and extension data.
User queriesPage through users or user IDs, retrieve profiles in batches, and check registration status.
Profile updatesSynchronize profile changes such as nickname, avatar, and extension data from your backend.
PresenceQuery online state, connected platform details, and aggregated online token details.
Notification accountsCreate, update, and search server-side accounts used for system or business notifications.
Account governance EnterpriseBan, unban, or unregister users and page through disabled accounts.

Common APIs

Resource representations

Objects with an Info suffix in this module represent user data stored or returned by the OpenIM server. Endpoint pages highlight fields relevant to that operation; this page defines the complete shared field semantics.

UserInfo

UserInfo represents an OpenIM user profile used by user creation, user queries, and profile updates.

FieldTypeDescription
userIDstringOpenIM user ID. Keep a stable mapping to the account in your business system.
nicknamestringUser nickname.
faceURLstringUser avatar URL.
exstringBusiness extension data written and interpreted by your backend.
createTimeint64User creation time, normally a Unix timestamp in milliseconds.
appMangerLevelintApplication management level. The field name matches the server response.
globalRecvMsgOptintGlobal message receiving option. See GlobalRecvMsgOpt.
status EnterpriseintAccount status. See UserStatus.
addFriendPermission EnterpriseintPermission for incoming friend requests. See AddFriendPermission.
category EnterprisestringBusiness-defined user category.

PublicUserInfo

PublicUserInfo represents profile data that can be read by other users or business workflows.

FieldTypeDescription
userIDstringOpenIM user ID.
nicknamestringUser nickname.
faceURLstringUser avatar URL.
exstringPublic extension data.

Enums

UserStatus

UserStatus describes an account state and applies only to Enterprise account governance fields.

ValueNameDescription
0NormalActive account.
1BannedBanned account.
2ExpungedUnregistered or removed account.

GlobalRecvMsgOpt

ValueNameDescription
0ReceiveMessageReceive messages.
1NotReceiveMessageDo not receive messages.
2ReceiveNotNotifyMessageReceive messages without notifications.

OnlineStatus

ValueNameDescription
0OfflineOffline.
1OnlineOnline.

AddFriendPermission

AddFriendPermission applies only to Enterprise user profiles.

ValueNameDescription
0AddFriendAllowedAllow friend requests with approval.
1AddFriendAllowedNoReviewAllow friend requests without approval.
2AddFriendDeniedDeny incoming friend requests.

PlatformID

PlatformID identifies the client platform of a user connection.

ValueNameDescription
1IOSiOS.
2AndroidAndroid.
3WindowsWindows.
4OSXmacOS.
5WebWeb.
6MiniWebMini program or lightweight Web client.
7LinuxLinux.
8APadAndroid tablet.
9IPadiPad.
10AdminAdministrative client.
11HarmonyOSHarmonyOS.
12BotBot.

Integration advice

Use your business system as the source of truth for user IDs. Before creating an OpenIM user, complete registration, risk checks, and authorization in your business system, then store the mapping between the business account and OpenIM user ID in your backend database.

For client login, request credentials from your business backend and let the backend issue an OpenIM user token. Never embed an APP administrator token in client code, frontend environment variables, or mobile application packages.