Browse Platform API
Platform API

Before adding a friend

Copy

Validate a friend request before it is created.

HTTP request

POST {WEBHOOK_ADDRESS}/callbackBeforeAddFriendCommand

Request body

PropertyTypeDescription
callbackCommandstringcallbackBeforeAddFriendCommand.
fromUserIDstringRequest sender
toUserIDstringRequest recipient
reqMsgstringRequest message
exstringExtension data

Response

Return the common before-event response from Webhooks overview. Use nextCode: 1 to reject the operation.

Processing rules

  • Configuration key: beforeAddFriend.
  • OpenIM waits synchronously; timeout behavior follows failedContinue.