whatsapp-api-js - v6.1.1
    Preparing search index...

    Interface API

    interface API {
        blockUser(
            phoneID: string,
            ...users: string[],
        ): Promise<ServerBlockResponse>;
        unblockUser(
            phoneID: string,
            ...users: string[],
        ): Promise<ServerUnblockResponse>;
    }

    Implemented by

    Index

    Methods

    • Block a user from sending messages to the bot

      The block API has 2 restrictions:

      • You can only block users that have messaged your business in the last 24 hours
      • You can only block up to 64k users

      Parameters

      • phoneID: string

        The bot's phone ID from which to block

      • ...users: string[]

        The user phone numbers to block (the API doesn't fail if it's empty)

      Returns Promise<ServerBlockResponse>

      The server response

    • Unblock a user from the bot's block list

      Parameters

      • phoneID: string

        The bot's phone ID from which to unblock

      • ...users: string[]

        The user phone numbers to unblock (the API doesn't fail if it's empty)

      Returns Promise<ServerUnblockResponse>

      The server response

      Contrary to blocking, unblocking isn't restricted by the 24 hours rule