Update a trunk phone number
const url = 'https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/PhoneNumber/example';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"country_code":"1","country_iso":"US","phone_number":"15555550100","status":"active","type":"local"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.siprtc.io/v1/Accounts/example/SipTrunk/example/PhoneNumber/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "country_code": "1", "country_iso": "US", "phone_number": "15555550100", "status": "active", "type": "local" }'Overwrites a trunk phone number record: phone_number, type, country_code and country_iso are required and status is stored as sent, so send the current values of the fields you keep (an omitted status hides the number from lists). A vendor account can pass customer_id to act on a direct child account’s record.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of your account.
ID of the trunk.
ID of the trunk phone number record (not the number itself).
Query Parameters
Section titled “ Query Parameters ”Vendor accounts only: act on this direct child account instead of your own.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The new values.
object
Country calling code.
Example
1ISO 3166-1 alpha-2 country code.
Example
USPhone number, digits only without “+”.
Example
15555550100Number status on the trunk.
Example
activeNumber type.
Example
localResponses
Section titled “ Responses ”Updated (message “Trunk phone number updated successfully”).
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}A required field is missing, the record does not exist, the change failed, or the gateway did not supply your company (message “company id is empty”).
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Missing or wrong Basic-auth credentials (returned by the API gateway).
Example generated
exampleCustomer_id is not a direct child of your account.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Your account or the customer account could not be looked up.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}