Create a Phone
This method adds a number to the list of phone numbers to be allocated in runtime.
Invoking the Method Using REST
URL Syntax and Example
http(s)://[host:port/internalPath]/Application Name/version/[version]/dnis
https://gointeract.io/interact/version/2/dnis
HTTP Method
POST
HTTP Headers
User-Id: <Base 64 encode of username> User-Password: <Base 64 encode of user password> Tenant-Id: <account> Application-Key: <dnis application key> Environment-Name: <environment-name>
In the following example, the username is admin and the password is password:
User-Id: YWRtaW4= User-Password: cGFzc3dvcmQ= Tenant-Id: 12345678 Application-Key: 53475e5f1463f9ab2052ead Environment-Name: Prod
HTTP Body
{ "phoneNumber" : "2111234567", "dnId" : "4567", "groupName" : "test", "enabled" : true }
URI Field | Data Type | Description/Notes |
---|---|---|
phoneNumber | string | The complete phone number to be added, including all prefixes (area code, etc.). |
dnId | string | An identifier for the number, generally the last 4 or 6 digits of the phone number. |
groupName | string | A user defined logical association for the number. This field is not mandatory. |
enabled | boolean | If this flag is set to true , the new number is activated upon creation. |
Expected Responses
Response Scenario | Status Code/Header | Example Message |
---|---|---|
Success (number created successfully) | 200 | <number id> |
Invalid request parameter (bad request) | 400 | <reason> |
Invalid security headers | 401 "Unauthenticated-Reason" Header | { "code":"0x7000000", "message": "Request is unauthorized, missing or wrong credentials", "moreInfoUrl":"http://support.uniphore.com", } |
Number already exists | 409 | Cannot create Phone '<phone number>'. A phone with that name already exists |
General error (failure while creating the account) | 500 | exception |
Invoking the Method Using SOAP
WSDL URL
https://gointeract.io/interact/version/2/dnis/soap/dnis.wsdl
Headers
User-Id: <Base 64 encode of username> User-Password: <Base 64 encode of user password> Tenant-Id: <tenantId> Application-Key: <dnis application key> Environment-Name: <environment-name>
Input Parameters
Parameter | Description |
---|---|
phone | The complete phone number to be added, including all prefixes (area code, etc.). |
dnId | An identifier for the number, generally the last 4 or 6 digits of the phone number. |
group | A user defined logical association for the number. This field is not mandatory. |
enabled | If this flag is set to true , the new number is activated upon creation. |
Sample Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://com/jacada/interact/dnis/soap"> <soapenv:Header/> <soapenv:Body> <soap:CreateDnisPhoneRequest> <soap:phone>1-800-123-123</soap:phone> <soap:dnId>123</soap:dnId> <soap:group>Sales Group</soap:group> <soap:enabled>true</soap:enabled> </soap:CreateDnisPhoneRequest> </soapenv:Body> </soapenv:Envelope>
Expected Responses
Response Scenario | Example Message |
---|---|
Success (number created successfully) | <ns2:result>Success</ns2:result> <ns2:result><id of number></ns2:result> |
Invalid security headers | <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>0x7000000</faultcode> <faultstring>Request is unauthorized, missing or wrong credentials</faultstring> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> |
Number already exists | <ns2:result>Cannot create Phone '<phone number>'. A phone with that name already exists</ns2:result> |
General error (failure while creating the account) | exception (in XML format) |