SDKAppID
contained in the request URL is the SDKAppID
of the app.https://www.example.com
.
Sample:https://www.example.com?SdkAppid=$SDKAppID&CallbackCommand=$CallbackCommand&contenttype=json&ClientIP=$ClientIP&OptPlatform=$OptPlatform
Parameter | Description |
https | The request protocol is HTTPS and the request method is POST. |
www.example.com | Callback URL |
SdkAppid | SDKAppID assigned by the Chat console when the app is created |
CallbackCommand | Always Sns.CallbackPrevFriendAdd |
contenttype | Always json |
ClientIP | Client IP, such as 127.0.0.1 |
OptPlatform | Client platform. For valid values, see the description of OptPlatform in the Callback Protocols section of Third-Party Callback Overview. |
{"CallbackCommand": "Sns.CallbackPrevFriendAdd","Requester_Account": "id","From_Account": "id","FriendItem": [{"To_Account": "id1","Remark": "remark1","GroupName": "group1","AddSource": "AddSource_Type_Android","AddWording": "this is id1!"},{"To_Account": "id2","Remark": "remark2","GroupName": "group1","AddSource": "AddSource_Type_Android","AddWording": "this is id2!"}],"AddType": "Add_Type_Both","ForceAddFlags": 0,"EventTime": 1631777344870}
Field | Type | Description |
CallbackCommand | String | Callback command |
Requester_Account | String | UserID of the user who initiates the request |
From_Account | String | UserID of the user who requests to add friend |
FriendItem | Array | Parameter of the friend request |
To_Account | String | UserID of user to be added as friend |
Remark | String | Friend remarks set by From_Account for To_Account . For more information, see the Standard friend fields section in Contacts Management. |
GroupName | String | Friend list set by From_Account for To_Account . For more information, see the Standard friend fields section in Contacts Management. |
AddSource | String | Source from which a friend is added. For more information, see the Standard friend fields section in Contacts Management. |
AddWording | String | Friend request content. For more information, see the Standard friend fields section in Contacts Management. |
AddType | String | Friend adding mode. Valid values: Add_Type_Single : one-wayAdd_Type_Both (default): two-way |
ForceAddFlags | Integer | Flag denoting the friend is force added by an admin. Valid values: 1 : force adding0 : normal adding |
EventTime | Integer | Timestamp in milliseconds |
{"ActionStatus": "OK","ErrorCode": 0,"ErrorInfo": "","ResultItem": [{"To_Account": "id1","ResultCode": 0,"ResultInfo": ""},{"To_Account": "id2","ResultCode": 0,"ResultInfo": ""}]}
Field | Type | Required | Description |
ActionStatus | String | Yes | Request result. OK : successful; FAIL : failed |
ErrorCode | Integer | Yes | Error code. Valid values: 0 : processing by the app backend is successful.Other values: processing by the app backend fails. The Chat backend ignores this error by default. If the processing fails, set the error code to a value in the range of [38000, 39000]. |
ErrorInfo | String | Yes | Error information |
ResultItem | Array | Yes | Processing result from the app backend |
To_Account | String | Yes | UserID to be added as friend |
ResultCode | Integer | Yes | Result code. Valid values: 0 : allow adding as friend.Other values: do not allow adding as friend. To not allow adding as friend, set the result code to a value in the range of [38000, 39000]. |
ResultInfo | String | Yes | Error information |
この記事はお役に立ちましたか?