Use case 8: Search for an extension in a Data Source based on extension value
Follow this example to search for an extension in a Data Source based on example. For example, use this API if you want to get the details of extension 2001.
Prerequisites
-
The Service Provider Administrator (SPA) has created the Data Source and assigned the tenant organization or sub-organization to the Data Source.
-
The user logging into this API has the user security privileges View Resource Groups and View Extensions.
Step
-
Call the GET method on endpoint /api/em/v2/datasources/<Data Source ID>/extensions?extensionValue=2000 to get extensions and pass a parameter that limits the result to the specific extension that you want to find. The API will return empty data or the extension if found. The API returns the details of the extension and the associated Resource Groups and associated employee information.
Sample response:
Copy{
"data": [
{
"type": "extension",
"id": "639",
"attributes": {
"id": 639,
"extensionValue": "2000",
"recordingMode": 1,
"resourceGroups": [
{
"id": 12,
"name": "IP Pool1",
"resourceGroupTypeId": -501003
},
{
"id": 13,
"name": "IP Pool2",
"resourceGroupTypeId": -501003
}
],
"employee": {
"id": 214,
"firstName": "John",
"lastName": "Smith",
"organizationId": 171,
"organizationName": "My Test Org"
}
}
}
]
}