Updated on 2023-09-27 GMT+08:00

Adding Outbound Numbers to the Blacklist

Scenario

This interface is invoked to add outbound numbers to the blacklist in batches for a specified outbound campaign.

Usage Description

  • Prerequisites
    • You have applied for a developer account.
  • Restrictions
    • A blacklisted number can contain a maximum of 24 characters.
    • A blacklisted number can contain only digits, asterisks (*), and number signs (#).
    • A maximum of 20 numbers can be added to the blacklist at a time. Otherwise, the system displays a message indicating that the maximum number of blacklisted numbers that can be added at a time is exceeded, and no number is added to the blacklist.
    • The blacklisted number to be added each time cannot be duplicate. Otherwise, the system displays a message indicating that the number is duplicate, and no number is added to the blacklist.
    • The numbers to be added to the blacklist each time are not in the blacklist.
    • When both the validity period and expiration time are transferred, the specified time (validityexpirationtime) is used.
    • The maximum number of calls must be less than the number of call attempts set for the retry policy.

Method

This interface supports only the POST method.

URI

https://ip:port/rest/isales/v1/openapi/campaigns/{vdnId}/blocklist/add

In the URL, ip indicates the IP address of the CC-iSales server, and port indicates the HTTPS port number of the CC-iSales server.

Table 1 Parameters in the URL

No.

Parameter

Type

Mandatory or Not

Description

1

vdnId

Integer

Yes

VDN ID.

The value is an integer ranging from 1 to 9999.

Request Description

Table 2 Request header parameters

No.

Parameter

Type

Mandatory or Not

Description

1

Content-Type

String

Yes

The value is fixed to application/json; charset=UTF-8.

2

Authorization

String

Yes

For details about the generation mode, see C2 Monitoring, System Outbound Call, CDR, and Knowledge Base Interface Authentication.

Table 3 Request body parameters

No.

Parameter

Type

Mandatory or Not

Description

1

blocklist

List

Yes

A maximum of 20 numbers can be added to the blacklist.

A number can contain a maximum of 24 characters, including only digits, asterisks (*), and number signs (#).

2

validityExpirationTime

String

No

Expiration time. Expiration time = Time when the number is added + Validity period. For example, if two numbers are added to the blacklist at 2020-12-31 10:06:25 and the validity period is 120 hours, the expiration time is 2021-01-05 10:06:25.

3

validityTime

Integer

No

Validity period, in hours. The value ranges from 1 to 120.

4

restrictTimes

Integer

No

Maximum number of calls. This parameter must be set or left empty together with restrictPeriod. The value ranges from 1 to 100.

5

restrictPeriod

String

No

Restriction period. The options are 0 (every hour) and 1 (every day).

Example 1: "restrictTimes":1,"restrictPeriod":"0" indicates that if an outbound call is made at 10:06:25 on December 30, 2020, another outbound call cannot be made until 11:00:00 on December 30, 2020.

Example 2: "restrictTimes":1,"restrictPeriod":"1" indicates that if an outbound call is made at 10:06:25 on December 30, 2020, another outbound call cannot be made until 00:00:00 on December 31, 2020.

Response Description

Table 4 Response body parameters

No.

Parameter

Type

Description

1

resultCode

String

Error code. The value 0200000 indicates success, and other values indicate failure.

For details, see Table 5.

2

resultDesc

String

Description.

3

returnCode

String

Error code. The value 0200000 indicates success, and other values indicate failure.

For details, see Table 5.

4

returnDesc

String

Description.

Triggered Event

None

Error Codes

Table 5 Error code description

No.

Error Code

Description

1

0200001

Parameter error. For details about the error, see resultDesc.

2

0200006

Database operation error.

3

0200007

The number already exists in the blacklist.

4

0200018

Duplicate numbers exist.

5

0200029

The maximum number of numbers that can be added each time is exceeded.

6

02000001

Empty parameter.

7

02000002

The parameter contains invalid characters.

8

02000003

The parameter length cannot exceed the maximum length.

9

02000004

The parameter length cannot be less than the minimum length.

10

02000005

The parameter length must be within the specified range.

11

02000006

Incorrect parameter type.

12

02000007

Incorrect parameter value.

13

02000008

Parameter conversion error. Check the request parameters.

14

02000009

Incorrect parameter combination. Check the request parameters.

15

02000010

The hour and minute parameters must be set at the same time.

16

02000011

The number of parameters cannot exceed the specified number.

Example

  • The following provides an example of the request body of this interface:
    {
        "blocklist": [
                "13100000000",
                "13100000001",
                "13100000002",
                "13100000003"
        ],
       "validityExpirationTime":"2020-12-31 10:06:25",
       "restrictTimes":3,
       "restrictPeriod":"0"
    }
  • The following provides an example of the response body of this interface:
    {
        "resultCode": "0200000",
        "resultDesc": "The blocklist is added successfully"
    }