How to block calls in Engage using APIs?

Prev Next

This article walks you through configuring and utilizing the 8x8 CRM API to block phone numbers specifically for Engage-only tenants.

Prerequisites

Before you begin, download the 8x8 CRM API support documentation. The API allows you to Create, Read, Update, Delete records in the 8x8 Contact Center local CRM.

Applies to

Procedure

Configure CRM API credentials

To enable API access, you'll need to set up authentication credentials:

  1. Log in to 8x8 Contact Center Configuration Manager with an Admin account;

  2. Navigate to Integration > CRM API;

  3. Check the box for Enable CRM API Access;

  4. Define a username and password for the CRM API;

  5. Review and update the Access Right table according to your requirements.

Create a custom field for blocked numbers

You need to create a dedicated field in the CRM to track blocked numbers:

  1. In Configuration Manager for Contact Center, go to CRM > Fields > Customer Fields.

  2. Click + to add a Customer Field.

  3. For the Data Type, select Pick List.

  4. Enter the following values:

    • Field Name: BLOCK_NUMBER

    • Display Label: BLOCK_NUMBER

    set fields in CRM.png

  5. From the Pick List Values drop-down, select Edit Pick List Values.

  6. Click + Pick List Value. Do this twice for a total of two values.

  7. In the Values column, name the default value NOT_BLOCKED and the second value BLOCKED.

  8. Click Save.

    add values.png

Block numbers via API

Use an API execution tool like Postman to add blocked numbers to your CRM.

Set up your request

  1. Create a new HTTP request in your API tool

  2. Use your VCC environment URL in this format: https://vcc-environment.8x8.com/WAPI/wapi.php.Replace vcc-environment with your actual environment name (e.g., vcc-eu014).

Required fields

When adding a customer with a blocked number, include these mandatory fields according to the 8x8 CRM API Documentation (Add Customer):

  • “tenant” : “add tenant name”

  • “username” : “add username”

  • “password” : “add password”

  • “command-object” : “Customer”

  • “command-action” : “Add”

  • “firstname”: “add first name”

  • “lastname” : “add last name”

  • “BLOCK_NUMBER” : “BLOCKED”

blocked numbr.png

Your API request should now successfully create CRM records with the blocked flag set appropriately.

Check the flag in your phone script

Setting the flag on a customer record doesn’t block calls by itself. Your phone script also needs to check this field and hang up when it matches. See the script steps in [Block Numbers in 8x8 Contact Center]. When you select the pick list in the script, choose the BLOCK_NUMBER field and the BLOCKED value.

Update an existing customer to unblock their number

To modify an existing customer record and change the BLOCK_NUMBER custom field value from BLOCKED to NOT_BLOCKED:

  1. List All Customers
    First, retrieve a list of all customers to identify the customer you want to unblock:

  • ““tenant” : “add tenant name”

  • “username” : “add username”

  • “password” : “add password”

  • “command-object” : “Customer”

  • “command-action” : “List”

  • "accountnum": "%"

list.png

     Review the response to find the customer ID of the record you want to update.

  1. Update the Customer Record

    Once you have identified the customer, update their record with the blocked flag set to NOT_BLOCKED

  • ““tenant” : “add tenant name”

  • “username” : “add username”

  • “password” : “add password”

  • “command-object” : “Customer”

  • “command-action” : “Modify”

  • "accountnum": "add accountnum you wish to modify"

  • “BLOCK_NUMBER” : “NOT_BLOCKED”

not blocked.png

     Your API request should now successfully create or update CRM records with the blocked flag set appropriately.