Docs

Change number properties

https://api.apifonica.com/v2/accounts/{accountSID}/numbers/{numberSID}

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

ParameterDefaultDescriptionDefault 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;
sip_phone - enables mode to link Apifonica voice numbers with soft/hard phones;
Host for making sip calls is sip-eu.apifonica.com (read more about making sip-calls)
xml - enables default mode to request XML instructions.

voice_recording
false

Enables or disables voice recording for this number.

Important: This parameter is true only for the phone numbers with 'voice': 'true' and mode: xml

boolean: true or false

Request example

The following cURL request demonstrates updating account status.

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}"
}