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

Deleting an Outbound Number

Scenario

This interface is invoked to delete an outbound number for an outbound campaign.

Usage Description

  • Prerequisites
    • You have applied for a developer account.
    • The ID of the outbound campaign has been obtained.
  • Restrictions
    • An outbound number for which a call is ongoing cannot be deleted.
    • An outbound number for which a call has been completed cannot be deleted.
    • An outbound number in an ongoing task cannot be deleted.

Method

This interface supports only the POST method.

URI

https://ip:port/rest/isales/v1/openapi/campaigns/{vdnId}/calldata/{campaignId}/delete

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.

2

campaignId

Integer

Yes

ID of an outbound campaign.

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

sessionId

String

No

ID of a subscriber, which is sent back to the subscriber in the outbound call result.

The ID can contain a maximum of 32 characters.

2

called

String

No

Called number.

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

3

customField

String

No

User-defined field. You can delete numbers in batches based on this field. The value can contain a maximum of 200 characters.

4

recycleTime

String

No

Recycling time, in yyyy-mm-dd hh:mm:ss format.

5

recycleType

String

No

Recycling type. This parameter is valid only when recycleTime is set.

The options are as follows:

  • 1: The system deletes the outbound numbers whose recycleTime is earlier than the time specified by recycleTime (accurate to day) in the request.

    For example, if recycleTime is set to 2020-12-04 17:57:00 in the request, the system deletes all outbound numbers whose recycleTime is on December 4 or earlier in a specified outbound campaign.

  • 2: The system deletes the outbound numbers on the day specified by recycleTime.

    For example, if recycleTime is set to 2020-12-04 17:57:00 in the request, the system deletes the outbound numbers whose recycleTime is between 2020-12-04 00:00:00 and 2020-12-04 23:59:59 in a specified outbound campaign.

  • 3: The system deletes the outbound numbers whose recycleTime is the same as the value of recycleTime in the request.

6

archiveHistory

Integer

No

Whether to move outbound numbers to the history table.

The options are 0 and 1.

The value 0 indicates that outbound numbers are deleted without being moving to the history table. The value 1 indicates that outbound numbers are moved to the history table. The default value is 0.

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.

5

successCount

Integer

Number of successful operations.

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 outbound campaign does not exist.

4

0200028

The number cannot be deleted in the current state.

5

0200030

The time format is incorrect.

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:
    {
        "sessionId":"1"
    }
  • The following provides an example of the response body of this interface:
    {
        "resultCode": "0200000",
        "resultDesc": "",
        "returnCode": "0200000",
        "returnDesc": "",
        "successCount": 1
    }