Removing users from channels

Similar to adding users, you can remove users either by a REST API call, or via a FileMaker script in your helper file.

Removing users using a FileMaker script

The script is available in Helper file and is called API - Leave Channel. This script accepts an object with two keys users and channels.

  • users: it accepts a string with an user ID or an array of users ID

  • channels: it accepts an object with name and mode (optional) or an array of objects, with the same shape.

Examples

{
    "users": "USER_ID",
    "channels":
    {
        "name": "channel1",
        "mode": "ignore"
    }
}

API: Remove User from Channel

POST https://yourdomain.com/message/removeuser

You can use this method to remove one or more users from channels. You must pass the API key generated for your app to authenticate this reqeust.

Headers

NameTypeDescription

content-type

string

application/json

accept

string

application/json

Request Body

NameTypeDescription

apiKey

string

The API key generated for your BF app

users

array

array of user IDs and channels to be removed for those users

users[0].id

string

BF user id from the users table in the helper file

users[0].channels

array

any array of channel objects

{
    "users": [
        "USER_1_ID",
        "USER_2_ID"
    ]
}

Leaving Anonymous Channels

Users can only be removed from anonymous channels directly from the browser. The current browser tab that executes the action will be the one removed from the channel.

A user can be joined to an anonymous channel via a BF action called channelLeaveAnon.

Example:

{
    "action": "channelLeaveAnon",
    "options": {
        "channel": "anonymousChatRoom"
    }
}

Learn more:

channelLeaveAnon

Last updated