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
-
Use the following POST method on the Data Source Configuration API:
{{serverName}}/wfo/rest/em-api/v2/datasources/datasourceID/extensionrange/delete -
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.
-
-
In the POST body, use the parameters
extensionRangeStartandextensionRangeEndto specify the first and last extensions in the range. -
If the extensions contain text at the beginning, specify the text using the
extensionRangePrefixparameter. - If the extensions contain text at the end, specify the text using the
extensionRangePostfixparameter. - If the extensions are numbers only, include the
extensionRangePrefixandextensionRangePostfixparameters 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
{"extensionRangeStart":"10000","extensionRangeEnd":"10500","extensionRangePrefix":
"QA","extensionRangePostfix":""}