Skip to main content

Callback After User Registration Request

Function Description

The App business server can use this callback to receive notifications of user registration requests, allowing the App backend to perform actions like data synchronization.

Notes

  • To enable the callback, it is necessary to configure the callback URL and activate the switch corresponding to this callback protocol. For configuration methods, see the Callback Description document.
  • The direction of the callback is an HTTP/HTTPS POST request initiated by OpenIM Server to the App backend.
  • After receiving the callback request, the App business server needs to verify whether the command parameter in the request URL is their own SDKNAME parameter.
  • The APP business server must respond to this request within the timeout period.

Scenarios That May Trigger This Callback

  • After new users register an account through the client.

Timing of Callback

  • After OpenIM Server successfully processes a new user's account registration.

Interface Description

Request URL Example

In the following example, the callback URL configured by the App is https://callbackurl.

https://callbackurl?command=$UserRegisterCommand&contenttype=json

Request Parameter Description

ParameterDescription
httpsThe request protocol is HTTPS, and the method is POST.
https://callbackurlCallback URL
UserRegisterCommandFixed value: userRegisterAfterCommand
contenttypeFixed value: JSON
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringoperationID for global link tracing

Request Package Example

{
"callbackCommand": "userRegisterAfterCommand",
"secret": "YourSecretKey",
"users": {
"userID": "user123",
"nickname": "John Doe",
"faceURL": "http://example.com/path/to/face/image.png",
"ex": "Extra data",
"createTime": 1673048592000,
"appMangerLevel": 1,
"globalRecvMsgOpt": 1
}
}

Request Package Field Description

FieldTypeDescription
callbackCommandstringCallback command, here for post-user registration callback.
secretstringSecret key for verification.
usersobjectUser information object.
userIDstringUnique identifier of the user.
nicknamestringNickname of the user.
faceURLstringURL of the user's avatar.
exstringAdditional data field.
createTimeint64Timestamp of user creation (milliseconds).
appMangerLevelint32User's management level.
globalRecvMsgOptint32User's global message reception option.

Response Package Example

Operation Successful

Example of a successful operation response by the App backend after data synchronization.

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

Response Package Field Description

FieldValueDescription
actionCode0Indicates whether the business system's callback was executed correctly. 0 means the operation was successful.
errCode20001Custom error code, ranging between 20001-29999. Set when actionCode is not 0; set when nextCode is 1.
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 step command.