Use case 25: Delete a range of extensions

Follow this example to delete a range of extensions. A request can delete a maximum of 5,000 extensions. If the range includes non-existent extensions, the API processes the command and deletes all matching extensions. All parameters are case sensitive and must be written as specified.

Prerequisites

Get the following information:

  • The name or IP address of the server that hosts the data source.

  • The Data Source ID.

  • The first and last Extension IDs for the range of extensions that you want to delete.

Procedure 

  1. Use the following POST method on the Data Source Configuration API:

    {{serverName}}/wfo/rest/em-api/v2/datasources/datasourceID/extensionrange/delete

  2. In your POST request, specify the following variables:

    • serverName is the host name or IP address of the server that hosts the data source.

    • datasourceID is the ID number of the data source that hosts the extension to be deleted.

  3. In the POST body, use the parameters extensionRangeStart and extensionRangeEnd to specify the first and last extensions in the range.

  4. If the extensions contain text at the beginning, specify the text using the extensionRangePrefix parameter.

  5. If the extensions contain text at the end, specify the text using the extensionRangePostfix parameter.
  6. If the extensions are numbers only, include the extensionRangePrefix and extensionRangePostfix parameters with empty values.

Example

You have a server named myConsolidatedServer. The server hosts a single data source with ID 101. The data source hosts 10,000 extensions. Extensions either start with the prefix "QA" or "QB", do not contain a suffix (postfix), and are numbered consecutively starting from 10001.

You want to delete extensions QA10001 to QA10500. Using POSTMAN, you submit the following request.

POST method and URL

POST http://{{myConsolidatedServer}}/wfo/rest/em-api/v2/datasources/101/extensionrange/delete

Body

Copy
{"extensionRangeStart":"10000","extensionRangeEnd":"10500","extensionRangePrefix":
"QA","extensionRangePostfix":""}

Use cases

Use case 22: Delete multiple extensions