Skip to main content

User Online Status Callback

Functional Description

The App business server can change the user status to online through this callback.

Precautions

  • To enable the callback, you must configure the callback URL and turn on the switch corresponding to this callback protocol. See the Callback Description document for configuration methods.
  • The callback direction is an HTTP/HTTPS POST request initiated by OpenIM Server to the App backend.
  • The APP business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • User initiates an online request to log in through the client.
  • The user's client successfully reconnects after a network disconnection.
  • Set the user's custom status.

Timing of Callback

  • When the user goes online.

Interface Description

Request URL Example

Here CallbackCommand is: callbackAfterUserOnlineCommand

{WEBHOOK_ADDRESS}/callbackAfterUserOnlineCommand?contenttype=json

Request Package Example

{
"userID": "user123",
"callbackCommand": "callbackAfterUserOnlineCommand",
"platformID": 3,
"platform": "Windows"
}

Request Package Field Description

ObjectTypeDescription
userIDstringUnique identifier of the user
callbackCommandstringCallback command, here it is the user online status callback
platformIDint64Platform ID
PlatformstringPlatform name

Response Package Example

Handling Result

User online.

{
"actionCode": 0,
"errCode": 0,
"errMsg": "",
"errDlt": "",
"nextCode": ""
}

Response Package Field Description

FieldValueDescription
actionCode0Indicates whether the business system callback was executed correctly. 0 means the operation was successful.
errCode0Custom error code, 0 here means ignore the callback result.
errMsg"An error message"Simple error message corresponding to the custom error code.
errDlt"Detailed error information"Detailed error information corresponding to the custom error code.
nextCode1Next execution instruction, 1 means refusing to continue execution, set when actionCode is 0.