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
Parameter | Description |
---|---|
https | The request protocol is HTTPS, and the method is POST. |
https://callbackurl | Callback URL |
UserRegisterCommand | Fixed value: userRegisterAfterCommand |
contenttype | Fixed value: JSON |
Header
Header Name | Example Value | Optional | Type | Description |
---|---|---|---|---|
operationID | 1646445464564 | Required | string | operationID 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
Field | Type | Description |
---|---|---|
callbackCommand | string | Callback command, here for post-user registration callback. |
secret | string | Secret key for verification. |
users | object | User information object. |
userID | string | Unique identifier of the user. |
nickname | string | Nickname of the user. |
faceURL | string | URL of the user's avatar. |
ex | string | Additional data field. |
createTime | int64 | Timestamp of user creation (milliseconds). |
appMangerLevel | int32 | User's management level. |
globalRecvMsgOpt | int32 | User'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
Field | Value | Description |
---|---|---|
actionCode | 0 | Indicates whether the business system's callback was executed correctly. 0 means the operation was successful. |
errCode | 20001 | Custom 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. |
nextCode | 1 | Next step command. |