Update a SIP domain
const url = 'https://api.siprtc.io/v1/Accounts/example/Sips/Domains/1';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"ip_auth":{},"name":"Head office PBX","user_auth":{}}'};
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/Sips/Domains/1 \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "ip_auth": {}, "name": "Head office PBX", "user_auth": {} }'Changes the display name, ip_auth or user_auth of one of your SIP domains; fields you leave out keep their current values. Other fields in the body, including status, domain_prefix and application_id, are ignored: the domain name cannot be changed, and the application is changed with PATCH.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of your account.
ID of the SIP domain.
Request Bodyrequired
Section titled “ Request Bodyrequired ”Fields to change.
object
New source-address list, in the same format as on create.
object
New display name of the domain.
Example
Head office PBXNew user authentication settings.
object
Responses
Section titled “ Responses ”Updated ({“status”: “sip domain updated”}).
object
Short description of what happened, for example “endpoint updated”, “endpoint deleted”, “sip domain updated” or “domain deleted”.
Example
{ "status": "endpoint updated"}The body could not be read; the response body is an empty JSON object.
object
Example generated
{}Missing or wrong Basic-auth credentials (returned by the API gateway).
Example generated
exampleDomain_id is not a positive number (body “Invalid Request”).
Example generated
exampleThe change could not be saved; the body is the error text.
Example generated
exampleNo domain with this ID on your account (errors.body “record not found”).
object
The error detail.
object
Error text as reported by the data store, for example “record not found”.
Example
{ "errors": { "body": "record not found" }}