Skip to main content

is_friend

Description

  • Check if two users are friends.

Request Method

  • post

Request URL

  • {API_ADDRESS}/friend/is_friend
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringUsed for global traceability, recommended to use a timestamp for uniqueness in each request.
tokeneyJhbxxxx3XsRequiredstringAdmin token

Request Body Example

{
"userID1": "11111111",
"userID2": "11111112"
}
Field NameOptionalTypeDescription
userID1RequiredstringUser ID
userID2RequiredstringUser ID

Success Response Example

{
"errCode": 0,
"errMsg": "",
"errDlt": "",
"data": {
"inUser1Friends": true,
"inUser2Friends": true
}
}

Success Response Parameters

Parameter NameTypeDescription
errCodeintError code, 0 means success
errMsgstringBrief error message, empty if successful
errDltstringDetailed error information, empty if successful
dataobjectGeneral data object, structure below
inUser1Friendsbooleantrue: userID2 is in userID1's friend list
inUser2Friendsbooleantrue: userID1 is in userID2's friend list

Failure Response Example

{
"errCode": 1004,
"errMsg": "RecordNotFoundError",
"errDlt": ": [1004]RecordNotFoundError"
}

Failure Response Parameters

Parameter NameTypeDescription
errCodeintError code, refer to the global error code documentation
errMsgstringBrief error message
errDltstringDetailed error message