Auto Attendant API
Overview
Auto Attendant (AA) is intended for business customers who want to provide an automated means of directing incoming calls to the appropriate person within the organization, typically to offload this task from a receptionist and also offer a simple menu system ("for menu, press 1, for transfer to phone, press 2," etc.) Restcomm Auto Attendant helps service providers enable their enterprise customers to Edit Autoattendant,manage users,assign phone numbers and assign extensions. Enterprise Customers can define different menus for given Auto Attendant. For example
-
Work hour menu” provides option to caller to reach to out Extension etc
-
Non work hours menu” can request to call back during working hours
-
Special day menu” can announce different greetings
Auto Attendant API
Auto Attendant API allows CSP Accounts to Edit Add Autoattendant,manage users, assign,
add phone numbers and assign,add extensions.
Restcomm Auto Attendant API can be broadly classified into below categories:
The API(s) described in this document are only available for communication providers. In addition, communication providers also have access to API(s) exposed to business customers. Please sign in to you Auto Attendant Console to see the API(s) available to business customers. |
When the API returns a timestamp or expects date/timestamp as a request parameter, the format given is an ISO-8601 date/time string, like YYYY-MM-DDTHH:MM:SS±[hh][mm]. For example 2019-10-10T13:13:48+0000 . Note that the given date/time is inclusive and is assumed to be in the UTC timezone. Hence offset ±[hh][mm] will always be +0000.
|
Enterprise
Create Enterprise
This endpoint is used to create an enterprise in the Auto Attendant application.
Create Enterprise will add unique enterprise names for a given CSP.
Request Parameters
Parameter | Description |
---|---|
name |
Mandatory name of an enterprise. Name must be unique within the given CSP organisation. |
enterpriseAdmin |
Enterprise Admin (BG-ADMIN) data explained in the table below that will be assigned as the admin of this enterprise. An aaccount will be created on Restcomm with these values. |
extFromPhoneNumber |
Optional. Define |
Response Body
The response body will contain code, corresponding message and data of the enterprise if successfully created. The HTTP response will be 201 Created (OK).
The response is returned in a JSON format as shown in the example below. All available parameters are listed below.
Parameter | Description |
---|---|
code |
Sub-error response code |
message |
Message describing the error, if an error occurred. Or a success message, if successful. |
data |
Enterprise data as explained in the table below. |
Data Parameter
Data Parameter | Description |
---|---|
sid |
Unique Enterprise Id |
accountEmail |
Unique Restcomm Account that created this particular enterprise. |
dateCreated |
Timestamp when this enterprise was created |
dateUpdated |
Timestamp when this enterprise was updated |
name |
Name of this enterprise |
uri |
Unique URI that you can call to get only this specific enterprise. |
aaSystemCount |
Number of Auto Attendant systems assigned to this enterprise. |
enterpriseAdminEmail |
Email id of enterprise Admin |
Response Parameters
Create Enterprise API can also return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code | HTTP Status |
---|---|
Error Message |
Description |
Category |
460 |
409 |
Enterprise name not unique |
Enterprise name already exists in the database |
Create Enterprise, Update Enterprise |
484 |
409 |
supportUser not unique |
User already exists |
Create Enterprise, Update Enterprise |
499 |
409 |
Error in creating an account on Restcomm |
Error while creating an account in Restcomm |
Create Enterprise, Update Enterprise |
Example:
{ "name": "test Enterprise", "enterpriseAdmin": { "emailId": "jane.doe@yourcompany.com", "password": "yourpassword", "name": "testbg" } }
From the bash terminal you can run the command below:
curl -X POST \ https://yourcompany.com/autoattendant/enterprise \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "name": "test Enterprise", "enterpriseAdmin": { "emailId": "jane.doe@yourcompany.com", "password": "yourpassword", "name": "testbg" } }’
If creation of Enterprise is successful, below is the response returned:
{ "data": { "sid": "EN54e3389b5bf34896876b86e139cca614", "dateUpdated": "2020-01-27T11:14:10+0000", "dateCreated": "2020-01-27T11:14:10+0000", "accountEmail": "jane.doe@yourcompany.com", "uri": "/autoattendant/enterprise/search/EN54e3389b5bf34896876b86e139cca614", "name": "test Enterprise", "aaSystemCount": 0, "enterpriseAdminEmail": "jane.doe@yourcompany.com" }, "code": 200, "message": "OK" }
If creation fails, below response is returned with corresponding HTTP Error Code
{ "errorCode": "460", "message": "Enterprise name not unique", "data": { "name": "test Enterprise", "enterpriseAdmin": { "emailId": "jane.doe@yourcompany.com", "password": "yourpassword", "status": "ACTIVE", "name": "testbg" } } }
Get list of Enterprise
List Enterprise API allows users to list all the enterprises created under that organisation
, which means under that CSP account.
Paging
The following paging parameters are supported
Query Parameter | Description |
---|---|
page |
Which page of Enterprise records to return, starting from 0. |
pageSize |
Number of records returned per page |
If search API is called without page and pageSize parameters, by default pageSize will be set to 10, and page will be 0 to avoid retrieving all data in a single API call.
|
Filtering
The ollowing filtering parameters are supported.
Query Parameter | Description |
---|---|
Name |
Optional parameter. Only show Enterprises that match name text, partially or fully. |
startTime |
Optional parameter. Only show enterprises that were created on this date/time or later, given as an ISO-8601 date/time string, like YYYY-MM-DDTHH:MM:SS (for example 2018-10-05T22:45:32) or, if you want to omit the time, YYYY-MM-DD (for example 2018-10-05). When only a date is provided the time is assumed to be at midnight of the given date. Note that the given date/time is inclusive and is assumed to be in UTC timezone. |
endTime |
Optional parameter. Only show enterprises that were created on this date/time or earlier, given as an ISO-8601 date/time string, like YYYY-MM-DDTHH:MM:SS (for example 2018-10-06T02:10:03) or, if you want to omit the time, YYYY-MM-DD (for example 2018-10-06). When only a date is provided the time is assumed to be at midnight of the given date. Note that the given date/time is inclusive and is assumed to be in UTC timezone. |
Sorting Information
You can use the SortBy GET query parameter to determine which attribute you want to sort by and in what order. 'asc' stands for ascending and 'desc' for descending sort ordering. Here’s the overall format: SortBy=<sorting attribute>:<direction>. If no direction parameter is provided, then the listing of calls is sorted by the attribute in ascending order. Below you can find the possible attributes you can sort by:
Response Parameters
Search Enterprise API will return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section.
The response returned is in a JSON format as shown in the example below. All SDR parameters are listed below.
Code | Description |
---|---|
code |
Sub-error response code |
message |
Message describing the error, if an error occurred. Or a success message, if successful. |
data |
data of search as explained in table below |
Data parameters
Data Parameter | Description |
---|---|
result |
list of Enterprise data as explained in the Data Parameter section. |
pageSize |
Number of records returned per page. |
total |
Total Number of records |
page |
Which page of records to return. |
numPages |
Total number of pages |
start |
Starting offset of page |
end |
Ending offset of page |
firstPageUri |
Unique URI that you can call to get records in First page |
nextPageUri |
Unique URI that you can call to get records in next page |
uri |
Unique URI that you can call to get records |
Example:
From the bash terminal you can run the command below:
curl -X GET \ https://yourcompany.com/autoattendant/enterprise/search?pageSize=2&page=0 \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \
Below is the response returned:
{ "data": { "result": [ { "sid": "EN838bcdf35f9d421fad3ab516195b873b", "dateUpdated": "2020-01-21T13:35:19+0000", "dateCreated": "2020-01-21T13:35:16+0000", "accountEmail": "jane.doe@yourcompany.com", "uri": "/autoattendant/enterprise/search/EN838bcdf35f9d421fad3ab516195b873b", "name": "Enterprise2", "aaSystemCount": 2, "enterpriseAdminEmail": "admin@doecompany.com" }, { "sid": "ENc4a6ddacbea548f7b7b2dca120d5ff20", "dateUpdated": "2020-01-15T05:36:10+0000", "dateCreated": "2020-01-15T05:36:09+0000", "accountEmail": "jane.doe@yourcompany.com", "uri": "/autoattendant/enterprise/search/ENc4a6ddacbea548f7b7b2dca120d5ff20", "name": "Enterprise1", "aaSystemCount": 3, "enterpriseAdminEmail": "jane.doe@doecompany.com" } ], "pageSize": 10, "total": 2, "page": 0, "numPages": 1, "start": 0, "end": 1, "firstPageUri": "/autoattendant/enterprise/search/?pageSize=10&page=0", "uri": "/autoattendant/enterprise/search/?pageSize=10&page=0" }, "code": 200, "message": "OK" }
Get Single Enterprise
Single Enterprise search API allows users to retrieve specific Enterprise created under that “organization” which means under that CSP.
Response Parameters
Search Enterprise API will return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section.
Error Code | HTTP Status |
---|---|
Error Message |
Description |
Category |
467 |
409 |
Enterprise not found |
Enterprise is not found. |
Update Enterprise, Search Enterprise, Delete Enterprise |
Example:
From the bash terminal you can run the command below:
curl -X GET \ https://yourcompany.com/autoattendant/enterprise/search/EN838bcdf35f9d421fad3ab516195b873b \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \
Below is the response returned:
{ "data": { "sid": "EN838bcdf35f9d421fad3ab516195b873b", "dateUpdated": "2020-01-21T13:35:19+0000", "dateCreated": "2020-01-21T13:35:16+0000", "accountEmail": "jane.doe@yourcompany.com", "uri": "/autoattendant/enterprise/search/EN838bcdf35f9d421fad3ab516195b873b", "name": "Enterprise2", "aaSystemCount": 2, "enterpriseAdminEmail": "admin@doecompany.com" }, "code": 200, "message": "OK" }
Update Enterprise System
This endpoint will be used to update an existing enterprise.
Request Parameters
Parameter | Description |
---|---|
enterpriseSid |
Unique Id of the enterprise |
name |
Name must be unique within given CSP organization. |
Response Body
The response body will include code, corresponding message and data of the enterprise it was successfully updated. HTTP response will be 200 OK.
The returned response is in a JSON format as shown in the example below. All available parameters are listed below.
Parameter | Description |
---|---|
code |
Sub-error response code |
message |
Message describing error if error occurred or success message |
data |
Enterprise data as explained in the Data Parameters section. |
Update Enterprise API can also return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code | HTTP Status |
---|---|
Error Message |
Description |
Category |
460 |
409 |
Enterprise name not unique |
Enterprise name already exists in the database. |
Create Enterprise, Update Enterprise |
484 |
409 |
supportUser not unique |
User already exists |
Create Enterprise, Update Enterprise |
467 |
409 |
Enterprise not found |
Enterprise Id not found |
Create Enterprise, Update Enterprise |
Example
{ "name" : "Enterprise3" }
From the bash terminal you can run the command below:
curl -X PUT \ https://yourcompany.com/autoattendant/enterprise/EN54e3389b5bf34896876b86e139cca614 \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "name" : "Enterprise3" }’
If updating of Enterprise is successful, below is the response returned:
{ "data": { "sid": "EN54e3389b5bf34896876b86e139cca614", "dateUpdated": "2020-01-27T11:14:10+0000", "dateCreated": "2020-01-27T11:14:10+0000", "accountEmail": "youremail@company.com", "uri": "/autoattendant/enterprise/search/EN54e3389b5bf34896876b86e139cca614", "name": "Enterprise3", "aaSystemCount": 0, "enterpriseAdminEmail": "jane.doe@yourcompany.com" }, "code": 200, "message": "OK" }
If update of enterprise fails, below is the response returned. Exact error code and message will depend on error occurred.
{ "errorCode": "467", "message": "Enterprise not found", "data": { "sid": "EN838bcdf35f9d421d3ab516195b873b" } }
Delete Enterprise
This endpoint will be used to delete an existing enterprise.
Response Body
The response body will include code, corresponding message and data of Enterprise if it was successfully deleted. HTTP response will be 200 OK.
The returned response is in a JSON format as shown in the example below. All available parameters are listed below.
Parameter |
Description |
code |
Sub-error response code |
message |
Message describing error if error occurred or success message |
data |
Enterprise data as explained in the Data Parameter section. |
Response Parameters
Delete Enterprise API can also return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code |
HTTP Status |
Error Message |
Description |
Category |
467 |
409 |
Enterprise not found |
Enterprise SID doesn’t exist in the system |
Update Enterprise, Delete enterprise, Get Enterprise |
482 |
409 |
Enterprise has AutoAttendant systems assigned to it |
Enterprise has active Auto Attendant systems |
Delete Enterprise |
Example:
the bash terminal you can run the command below:
curl -X DELETE \ https://yourcompany.com/autoattendant/enterprise/ENb6eb071d21124dbab20b095c25f1274f \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \
If deletion of Enterprise is successful, below is the response returned:
{ "data": { "sid": "EN54e3389b5bf34896876b86e139cca614", "dateUpdated": "2020-01-27T11:14:14+0000", "dateCreated": "2020-01-27T11:14:10+0000", "accountEmail": "youremail@company.com", "uri": "/autoattendant/enterprise/search/EN54e3389b5bf34896876b86e139cca614", "name": "test Enterprise", "aaSystemCount": 0, "enterpriseAdminEmail": "jane.doe@yourcompany.com" }, "code": 200, "message": "OK" }
If deletion fails, below response is returned with a corresponding HTTP error code.
{ "errorCode": "467", "message": "Enterprise not found", "data": { "sid": "EN54e3389b5bf34896876b86e139cca614" } }
User
Delete User
This endpoint will be used to delete an existing user.
Response Body
The response body will include code, corresponding message and data of User if it was successfully deleted. HTTP response will be 200 OK.
The returned response is in a JSON format as shown in the example below. All available parameters are listed below.
Parameter | Description |
---|---|
code |
Sub-error response code |
message |
Message describing the error, if an error occurred. Or a success message, if successful. |
data |
User data as explained in the Data Parameters section. |
Response Parameters
Delete User API can also return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code | HTTP Status |
---|---|
Error Message |
Description |
Category |
487 |
409 |
Auto Attendant user Id not found |
User SID doesn’t exist in the system |
Update User, Delete user, |
Get User |
501 |
409 |
The user is an enterprise admin |
the user is an enterprise admin |
Delete user |
Example:
From the bash terminal you can run the command below:
curl -X DELETE \ https://yourcompany.com/autoattendant/user/RCS31e4303c3d06409a9e7a847fc7221bd0 \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'
If user deletion is successful, below is the response returned:
{ "data": { "sid": "RCS31e4303c3d06409a9e7a847fc7221bd0", "dateUpdated": "2020-01-27T05:50:02+0000", "dateCreated": "2020-01-27T05:50:02+0000", "accountEmail": "youremail@company.com", "uri": "/autoattendant/user/search/RCS31e4303c3d06409a9e7a847fc7221bd0", "emailId": "jane.doel@youcompany.com", "status": "ACTIVE", "role": "BG_ADMIN", "name": "Test BG 2" }, "code": 200, "message": "OK" }
If deletion fails, below response is returned with corresponding HTTP error code.
{ "code":470, "message":"User not found", “data”:{ "sid”:” RCS31e4303c3d06409a9e7a847fc7221bd0” } }
Announcement
All the API(s) exposed are the same for communication providers and business customers. |
Auto Attendant System
Create AutoAttendant System
This endpoint will be used to create an Auto Attendant system. Only users with the CSP_ADMIN role can create such one.
Request Parameters
Parameter | Description |
---|---|
name |
Name of the Auto attendant system |
timezoneId |
Time zone in which Auto Attendant system is being used |
aaNumberSids |
List of phone numbers Sid to be assigned to this system |
extensionNumberSids |
List of extension numbers sid to be assigned to this system |
description |
Description of the Auto Attendant system |
enterpriseSid |
Sid of the enterprise the Auto Attendant system belongs to. |
timeoutSeconds |
timeout duration of Auto Attendant system |
timeoutAction |
Action type and Action data if needed to perform after timeout |
timeoutMaxOccurance |
Consecutive timeout occurrences are allowed to timeout after which timeout action is performed. |
invalidExtensionAction |
Action type and action data (if needed) to perform after invalid extension max occurrences. |
invalidExtensionMaxOccurance |
Consecutive occurrences that the user presses invalid extension to perform invalid extension action |
invalidInputAction |
Action type and action data (if needed) to perform after invalid input max occurrences |
invalidInputMaxOccurance |
Consecutive occurrences that the user presses unknown input |
Response Body
Response Body will carry Code, corresponding message and unique-id if creation of Auto Attendant-System was successful.
Parameter | Description |
---|---|
code |
Sub-error response code |
message |
Message describing error if error occurred or success message |
data |
Auto Attendant system data describe in below table |
Data Parameters
Data parameters | Description |
---|---|
sid |
Unique ID generated by system |
dateUpdated |
Timestamp when this Auto Attendant system was updated |
dateCreated |
Timestamp when this Menu was created |
accountEmail |
Restcomm Account that created this particular record |
uri |
Unique URI that you can call to get only this specific Auto Attendant system |
name |
Name of the Auto Attendant system |
description |
Description of the Auto Attendant system. |
status |
Status of the Auto Attendant system. |
aaNumbers |
List of phone numbers assigned to the Auto Attendant system |
extensions |
List of Extensions assigned to the Auto Attendant system |
enterpriseSid |
Sid of the enterprise the Auto Attendant system belongs to. |
timeoutSeconds |
timeout duration of Auto Attendant system |
timeoutMaxOccurance |
Consecutive timeout occurrences are allowed to timeout after which timeout action is performed. |
timeoutAction |
Action type and Action data if needed to perform after timeout |
invalidExtensionMaxOccurance |
Consecutive occurrences that the user presses invalid extension to perform invalid extension action |
invalidExtensionAction |
Action type and action data (if needed) to perform after invalid extension max occurrences |
invalidInputMaxOccurance |
Consecutive occurrences that the user presses unknown input |
invalidInputAction |
Action type and action data (if needed) to perform after invalid input max occurrences |
timezoneId |
Time zone in which Auto Attendant system is being used |
Response Parameters
Create Auto Attendant system API will return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code | HTTP Status |
---|---|
Error Message |
Description |
Category |
467 |
409 |
Enterprise not found |
Enterprise for which Auto Attendant System is to be added is not found. |
Create Auto Attendant System |
Update Auto Attendant System |
493 |
409 |
PhoneNumber is not an Extension number |
extension number assigned is not configured as extension |
Create Auto Attendant System |
Update Auto Attendant System |
491 |
409 |
PhoneNumber not found |
Phone number is to be added is not found. |
Create Auto Attendant system |
Example
{ "name": "test12", "description": "test123", "status": "ACTIVE", "timezoneId": "Asia/Calcutta", "aaNumbers": ['PH440d21f6599d46f5930e9955462675756’'], "extensions": ['PH440d21f6599d46f5930e995251273429'], "timeoutSeconds": "1", "autoattendantSid": "AA9cb83e8b36884e54afc48488d8302274", "timeoutAction": { "actionType": "ANNOUNCEMENT_HANGUP", "actionData": "AN42b3d3e952ff47ecba9d487095a2bc4e" }, "timeoutMaxOccurance": "2", "invalidExtensionAction": { "actionType": "DIAL_BY_EXTENSION" }, "invalidExtensionMaxOccurance": "1", "invalidInputAction": { "actionType": "ANNOUNCEMENT_RETURN", "actionData": "AN5067f6f1c8f546dd909df1f50ee9f935" }, "invalidInputMaxOccurance": "2" }
From the bash terminal you can run the command below:
curl -X POST \ https://yourcompany.com/autoattendant/system\ --user ' '\{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d ' { "name": "test12", "description": "test123", "status": "ACTIVE", "timezoneId": "Asia/Calcutta", "aaNumbers": ['PH440d21f6599d46f5930e9955462675756’'], "extensions": ['PH440d21f6599d46f5930e995251273429'], "timeoutSeconds": "1", "autoattendantSid": "AA9cb83e8b36884e54afc48488d8302274", "timeoutAction": { "actionType": "ANNOUNCEMENT_HANGUP", "actionData": "AN42b3d3e952ff47ecba9d487095a2bc4e" }, "timeoutMaxOccurance": "2", "invalidExtensionAction": { "actionType": "DIAL_BY_EXTENSION" }, "invalidExtensionMaxOccurance": "1", "invalidInputAction": { "actionType": "ANNOUNCEMENT_RETURN", "actionData": "AN5067f6f1c8f546dd909df1f50ee9f935" }, "invalidInputMaxOccurance": "2" }’
If creation of Auto Attendant system is successful, below is the response returned:
{ "data": { "sid": "AA9cb83e8b36884e54afc48488d8302274", "dateUpdated": "2020-01-27T09:25:35+0000", "dateCreated": "2020-01-27T09:24:12+0000", "accountEmail": "jane.doel@youcompany.com", "uri": "/autoattendant/system/search/AA9cb83e8b36884e54afc48488d8302274", "name": "test12", "description": "test123", "status": "ACTIVE", "aaNumbers": [], "extensions": [ "1671331777" ], "enterpriseSid": "EN838bcdf35f9d421fad3ab516195b873b", "timeoutSeconds": 1, "timeoutMaxOccurance": 2, "timeoutAction": { "actionType": "ANNOUNCEMENT_HANGUP", "actionData": "AN42b3d3e952ff47ecba9d487095a2bc4e" }, "invalidExtensionMaxOccurance": 1, "invalidExtensionAction": { "actionType": "DIAL_BY_EXTENSION" }, "invalidInputMaxOccurance": 2, "invalidInputAction": { "actionType": "ANNOUNCEMENT_RETURN", "actionData": "AN5067f6f1c8f546dd909df1f50ee9f935" }, "timezoneId": "Asia/Calcutta" }, "code": 200, "message": "OK" }
If the creation of Auto Attendant system fails, below is the response returned. Exact error code and message will depend on error occurred
{ "errorCode": "491", "message": "PhoneNumber not found", "data": { "sid": "PH440d21f6599d46f5930e995251273429" } }
Delete Auto Attendant System
This endpoint will be used to delete an existing auto attendant system.
Request Parameters
Parameter |
Description |
autoAttendantSid |
SID to uniquely identify an Auto Attendant system |
Response Body
Response Body will carry Code, corresponding message and Auto Attendant system data if deletion of the Auto Attendant-System was successful.
Parameter |
Description |
code |
Sub-error response code |
message |
Message describing the error, if an error occurred. Or a success message, if successful. |
data |
Auto Attendant system data explained in table 2.5.5.1 Data Parameters |
Response Parameters
Delete Auto Attendant system API will return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. In addition, below are the Error that it can return
Error Code |
HTTP Status |
Error Message |
Description |
Category |
490 |
409 |
AutoAttendant System not found |
Auto Attendant system SID doesn’t exist in the system |
Update Auto Attendant System, Delete Auto Attendant System, Get Auto Attendant System |
503 |
409 |
Auto Attendant system has number assigned to it. |
Auto Attendant system has number assigned to it. |
Delete Auto Attendant System |
Example:
From the bash terminal you can run the command below:
curl -X DELETE \ https://yourcompany.com/autoattendant/system/AA9cb83e8b36884e54afc48488d8302274 \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \
If Auto Attendant system was deleted successfully, below is the response returned:
{ "data": { "sid": "AA9cb83e8b36884e54afc48488d8302274", "dateUpdated": "2020-01-27T09:25:36+0000", "dateCreated": "2020-01-27T09:24:12+0000", "accountEmail": "jane.doel@youcompany.com", "uri": "/autoattendant/system/search/AA9cb83e8b36884e54afc48488d8302274", "name": "test12", "description": "test123", "status": "ACTIVE", "aaNumbers": [], "extensions": [ "1671331777" ], "enterpriseSid": "EN838bcdf35f9d421fad3ab516195b873b", "timeoutSeconds": 1, "timeoutMaxOccurance": 2, "timeoutAction": { "actionType": "ANNOUNCEMENT_HANGUP", "actionData": "AN42b3d3e952ff47ecba9d487095a2bc4e" }, "invalidExtensionMaxOccurance": 1, "invalidExtensionAction": { "actionType": "DIAL_BY_EXTENSION" }, "invalidInputMaxOccurance": 2, "invalidInputAction": { "actionType": "ANNOUNCEMENT_RETURN", "actionData": "AN5067f6f1c8f546dd909df1f50ee9f935" }, "timezoneId": "Asia/Calcutta" }, "code": 200, "message": "OK" }
Phone Number
Create Phone number
This endpoint will be used to provision a phone number in Restcomm and make it available to AA-Admin and BG-Admin users. This will only be accessible to CSP admins.
Request Parameters
Parameter | Description |
---|---|
number |
Phone number |
isExtension |
True means the number is used as extension number, false means the number is used as phone number. |
enterpriseSid |
Sid of the enterprise the Number belongs to. |
extension |
Extension assigned to the number |
extensionSpokenName |
Name of the user the extension belongs to. |
autoAttendantSid |
(Optional) Used in case of phone numbers only sid of Auto Attendant system to which this number is to be assigned |
friendlyName |
friendly name of the phonenumber |
extensionType |
Should be one of the two values - client - number Here Client is Restcomm Client. |
extensionClientPassword |
Is needed when extension type is “client”. If you have set up an already existing Client, the password will be ignored and the existing password will remain valid. |
Response Body
The response body will include code, corresponding message and data of phone number if it was successfully created. HTTP response will be 201 Created200 OK.
The returned response is in a JSON format as shown in the example below. All available parameters are listed below.
Parameter | Description |
---|---|
code |
Sub-error response code |
message |
Message describing error if error occurred or success message |
data |
Phone number data as explained in the table below. |
Data Parameter
Data Parameter | Description |
---|---|
sid |
Unique phoneNumber Sid |
accountEmail |
Unique Restcomm Account that created/updated this particular Phone number |
dateCreated |
Timestamp when this Enterprise was created |
dateUpdated |
Timestamp when this Enterprise was updated |
number |
Phone number |
isExtension |
True if the number being added is an extension. false if the number will be considered an Auto Attendant number. |
uri |
Unique URI that you can call to get only this specific PhoneNumber |
enterpriseSid |
Sid of the enterprise the phoneNumber belongs to. |
extension |
Extension assigned to the number |
extensionSpokenName |
Name of the user the extension belongs to. |
extensionType |
Can have either "client or "number". |
Response Parameters
Create phoneNumber API can also return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code | HTTP Status |
---|---|
Error Message |
Description |
Category |
467 |
409 |
Enterprise not found |
Enterprise for which phoneNumber is to be added is not found. |
Create,update phone number |
510 |
409 |
PhoneNumber number already exists |
Phone number already exists |
Create,update phone number |
486 |
409 |
Error in provisioning number on Restcomm |
Number already provisioned in Restcomm |
Create,update phone number |
495 |
409 |
Password needed to provision new client in Restcomm |
Password not provided and is needed to provision new client |
Create phone number |
494 |
409 |
Error in provisioning client |
Client already provisioned in Restcomm or password does not meet the Restcomm policy |
Create phone number |
Example:
{ "extension": "123", "isExtension": true, "enterpriseSid": "EN54e3389b5bf34896876b86e139cca614", "number": "1234234234", "extensionSpokenName": "testextension" }
From the bash terminal you can run the command below:
curl -X POST \ http://yourcompany.com/autoattendant/phoneNumber \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \ -d '{ "extension": "123", "isExtension": true, "enterpriseSid": "EN54e3389b5bf34896876b86e139cca614", "number": "1234234234", "extensionSpokenName": "testextension" }’
If creation of Enterprise is successful, below is the response returned:
{ "data": { "sid": "PH720cff9bdc914d9c8fccc3bac340271d", "dateUpdated": "2020-01-27T11:24:22+0000", "dateCreated": "2020-01-27T11:24:22+0000", "accountEmail": "jane.doel@youcompany.com", "uri": "/autoattendant/phonenumber/search/PH720cff9bdc914d9c8fccc3bac340271d", "number": "1234234234", "extensionSpokenName": "testextension", "isExtension": true, "extension": "123", "extensionType": "number" }, "code": 200, "message": "OK" }
If creation fails, below response is returned with corresponding HTTP Error Code
{ "errorCode": "510", "message": "PhoneNumber number already exists", "data": { "number": "1234234234", "extensionSpokenName": "testextension", "isExtension": true, "extension": "123", "enterpriseSid": "EN54e3389b5bf34896876b86e139cca614" } }
Delete Phone numbers
This endpoint will be used to delete an existing phone number.
Response Body
The response body will include code, corresponding message and data of phone number if it was successfully deleted. The HTTP response will be 200 OK.
The returned response is in a JSON format as shown in the example below. All available parameters are listed below.
Parameter |
Description |
code |
Sub-error response code |
message |
Message describing error if error occurred or success message |
data |
Phone number data as explained in the table 2.7.5.1 Data Parameter |
Response Parameters
Delete phoneNumber API can also return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section. Possibly returned error codes are listed below.
Error Code |
HTTP Status |
Error Message |
Description |
Category |
491 |
409 |
PhoneNumber not found |
Phone number SID doesn’t exist in the system |
Update phone number, Delete phone number, Get phone number |
508 |
409 |
This phone number cannot be deleted as it is being used in an Auto Attendant System. |
Phone number is included in an active Auto Attendant system |
Delete phone number |
Example:
From the bash terminal you can run the command below:
curl -X DELETE \ https://yourcompany.com/autoattendant/phonenumber/PH720cff9bdc914d9c8fccc3bac340271d \ --user ' \{your_account_SID}:\{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \
If phone number was successfully deleted, below is the response returned:
{ "data": { "sid": "PH720cff9bdc914d9c8fccc3bac340271d", "dateUpdated": "2020-01-27T11:24:22+0000", "dateCreated": "2020-01-27T11:24:22+0000", "accountEmail": "jane.doel@youcompany.com", "uri": "/autoattendant/phonenumber/search/PH720cff9bdc914d9c8fccc3bac340271d", "number": "1234234234", "extensionSpokenName": "testextension", "isExtension": true, "extension": "123", "extensionType": "number" }, "code": 200, "message": "OK" }
If deletion fails, below response is returned with corresponding HTTP Error Code
{ "errorCode": "491", "message": "PhoneNumber not found", "data": { "sid": "PH720cff9bdc914d9c8fccc3bac340271d" } }
HMAC Key
Get list of Hmac Keys
This endpoint will be used to get list of hmac key for single sign-on
Response Body
The response body will include code, corresponding message and data of hmac if it was successfully fetched. HTTP response will be 200 OK.
The returned response is in a JSON format as shown in the example below. All available parameters are listed below.
Code |
Description |
code |
Sub-error response code |
message |
Message describing the error, if an error occurred. Or a success message, if successful. |
data |
data of search as explained in table below |
Data parameters
Data Parameter |
Description |
result |
list of Phone number data as explained in the Data Parameters section. |
pageSize |
Number of records returned per page. |
total |
Total Number of records |
page |
Which page of records to return. |
numPages |
Total number of pages |
start |
Starting offset of page |
end |
Ending offset of page |
firstPageUri |
Unique URI that you can call to get records in First page |
nextPageUri |
Unique URI that you can call to get records in next page |
uri |
Unique URI that you can call to get records |
Example
From the bash terminal you can run the command below:
curl -X GET \ https://yourcompany.com/autoattendant/hmac/search \ --user ' {your_account_SID}:{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json'
Below is the response returned:
{ "data": { "result": [ { "sid": "OHKf1f0284e0ee44fcfacba0244230e38ab", "dateUpdated": "2020-02-21T06:17:43+0000", "dateCreated": "2020-02-21T06:17:43+0000", "accountEmail": "jane.doel@youcompany.com", "uri": "/autoattendant/restcomm/hmac/search/OHKf1f0284e0ee44fcfacba0244230e38ab", "organisationSid": "OR0abf61c2d27b438e88ac6aee721d5902", "hmacKey": "12345" } ], "pageSize": 10, "total": 1, "page": 0, "numPages": 1, "start": 0, "end": 0, "firstPageUri": "/autoattendant/restcomm/hmac/search/?pageSize=10&page=0", "uri": "/autoattendant/restcomm/hmac/search/?pageSize=10&page=0" }, "code": 200, "message": "OK" }
Get Single Hmac
Single hmac search API allows users to retrieve specific organisation hmac key.
Response Parameters
Search Enterprise API will return an error code and a corresponding HTTP error as mentioned in the Common Response Error Codes section.
Error Code |
HTTP Status |
Error Message |
Description |
Category |
458 |
409 |
Hmac key not found |
Hmac key not found |
Get Phonenumber |
Example
From the bash terminal you can run the command below:
curl -X GET \ https://yourcompany.com/autoattendant/hmac/search/OHKf1f0284e0ee44fcfacba0244230e38 \ --user ' {your_account_SID}:{your_account_token}' \ -H 'Cache-Control: no-cache' \ -H 'Content-Type: application/json' \
Below is the response returned:
{ "data": { "sid": "OHKf1f0284e0ee44fcfacba0244230e38ab", "dateUpdated": "2020-02-21T06:17:43+0000", "dateCreated": "2020-02-21T06:17:43+0000", "accountEmail": "jane.doel@youcompany.com", "uri": "/autoattendant/restcomm/hmac/search/OHKf1f0284e0ee44fcfacba0244230e38ab", "organisationSid": "OR0abf61c2d27b438e88ac6aee721d5902", "hmacKey": "12345" }, "code": 200, "message": "OK" }