Attach or detach a SIP user's application
const url = 'https://api.siprtc.io/v1/Accounts/example/Sip/endpoint/1';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"action":"sip_app_association","application_id":1024}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.siprtc.io/v1/Accounts/example/Sip/endpoint/1 \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "action": "sip_app_association", "application_id": 1024 }'Attaches an application to one of your SIP users with action sip_app_association (the application then handles the user’s calls), or detaches it with sip_app_deassociation. The application must belong to your account or be shared with it. Any other action changes nothing and answers 202 with {“status”: “endpoint updated”}.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of your account.
ID of the SIP user.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The association change.
object
Sip_app_association attaches the application; sip_app_deassociation detaches it (application_id is then ignored). Any other value changes nothing.
Example
sip_app_associationID of the application to attach. It must belong to your account or be shared with it.
Example
1024Responses
Section titled “ Responses ”The application was attached or detached.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}The action was not recognised; nothing changed.
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.
object
Human-readable explanation of the failure.
Example
{ "message": "Parent auth ID does not match"}Missing or wrong Basic-auth credentials (returned by the API gateway).
Example generated
exampleThe application does not belong to your account.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}Endpoint_id is not a positive number (body “Invalid Request”).
Example generated
exampleNo SIP user with this ID on your account, or the change could not be saved.
object
The error detail.
object
Error text as reported by the data store, for example “record not found”.
Example
{ "errors": { "body": "record not found" }}The application check could not be completed.
object
Human-readable explanation of the outcome.
Outcome of the request: “success” or “failed”.
Example
{ "message": "Invalid auth ID", "status": "success"}