Skip to main content

add_black

Brief Description

  • Add blackUserID to ownerUserID's blacklist, so that blackUserID cannot send messages to ownerUserID anymore.

Request Method

  • post

Request URL

  • http://x.x.x.x:10002/friend/add_black
Header NameExample ValueOptionalTypeDescription
operationID1646445464564RequiredstringoperationID is used for global link tracking
tokeneyJhbxxxx3XsRequiredstringAdministrator token

Request Sample Parameters

{
"ownerUserID": "11111111",
"blackUserID": "11111113",
"ex":"ex"
}
Field NameOptionalTypeDescription
ownerUserIDRequiredstringUser for whom the blacklist is added
blackUserIDRequiredstringID of the user being blacklisted
exOptionalstringExtension field

Successful Return Sample

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

Successful Return Sample Explanation

Parameter NameTypeDescription
errCodeintError code, 0 indicates success
errMsgstringBrief error message, empty when no error
errDlterrDltDetailed error message, empty when no error
dataobjectGeneral data object, the specific structure is shown below

Failed Return Sample

{
"errCode": 1003,
"errMsg": "DuplicateKeyError",
"errDlt": "==> github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/relation.(*BlackGorm).Create()@20->->Error 1062Error 1062: Duplicate entry '561373702-847892217' for key 'PRIMARY'"
}

Failed Return Sample Explanation

Parameter NameTypeDescription
errCodeintError code, refer to the global error code document
errMsgstringBrief error message
errDlterrDltDetailed error message