Change number properties
Overview
Phone number properties are changed by making the PUT request to /accounts/{accountSID}/numbers/{numberSID}.
The request must contain new values for the parameters listed below.
Input parameters
Parameter |
Default |
Description |
Value |
call_app_sid |
default_call_app_sid |
Link to the existing application, which is used for Call operations. For more details please refer to Create application article. |
existing application SID |
msg_app_sid |
default_msg_app_sid |
Link to the existing application, which is used for Message operations. For more details please refer to Create application article. Please note that only one of the parameters call_app_sid or msg_app_sid can be specified (the other must be null). |
existing application SID |
sip_password |
none |
Password for making calls by using the SIP protocol. Important This parameter makes sense only for the voice enabled phone numbers (local and sip type) |
String, minimum 8, maximum 32 symbols (combination of latin letters and numbers). |
endpoint_sid |
null |
Endpoint unique identifier For more details please refer to Link endpoint to number article |
none |
mode |
xml |
Parameter which regulates the phone number mode. Modes can be as following: end_point - enables sip-trunking mode; |
none |
voice_recording |
false |
Enables or disables voice recording for this number. |
boolean: true or false |
Value |
existing application SID |
Description |
Link to the existing application, which is used for Call operations. |
Default value |
default_call_app_sid |
Value |
existing application SID |
Description |
Link to the existing application, which is used for Message operations. Please note that only one of the parameters call_app_sid or msg_app_sid can be specified (the other must be null). |
Default value |
default_msg_app_sid |
Value |
String, minimum 8, maximum 32 symbols (combination of latin letters and numbers). |
Description |
Password for making calls by using the SIP protocol. Important This parameter makes sense only for the voice enabled phone numbers (local and sip type). |
Default value |
none |
Value |
no |
Description |
Endpoint unique identifier |
Default value |
null |
Value |
no |
Description |
Parameter which regulates the phone number mode. Modes can be as following: end_point - enables sip-trunking mode; |
Default value |
xml |
Value |
boolean: true or false |
Description |
Enables or disables voice recording for this number. Important: This parameter makes sense only for the phone numbers with "voice": "true". |
Default value |
false |
Request example
The following example shows how to update the link to the application and the mode for the number.
curl –X PUT https://api.apifonica.com/v2/accounts/{accountSID}/numbers/{numberSID} \ -H ‘Content-Type: application/json’ \ -d ‘{ “call_app_sid”: ”app3b033f1b-777b-3b53-8949-ca8f2c60bba1”, “mode”: ”sip_phone” }’ \ -u {accountSID}:{authToken}
Response example
{ "status_code": 200, "status_message": "OK", "uri": "/accounts/{accountSID}/numbers/{numberSID}" }