Create a SIP user
const url = 'https://api.siprtc.io/v1/Accounts/example/Sip/endpoint';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"codec_list":"PCMU,PCMA,OPUS","domain":"acme.sip.siprtc.io","name":"Reception","password":"S3cretPassw0rd!","prefix":"acme","presence":false,"status":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/example/Sip/endpoint \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "codec_list": "PCMU,PCMA,OPUS", "domain": "acme.sip.siprtc.io", "name": "Reception", "password": "S3cretPassw0rd!", "prefix": "acme", "presence": false, "status": true }'Creates a SIP user that phones and softphones can register with and provisions it on the SIP registrar. The SIP username is generated as prefix followed by the current Unix time in milliseconds. When your account belongs to a vendor with its own SIP domain, domain is replaced by that domain unless it already ends with the vendor’s host. New users have no application attached (application_id -1); attach one with PATCH. The response is the registrar record, including the password and its digest hashes.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of your account.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The SIP user to create.
object
Comma-separated codec preference list stored with the user.
Example
PCMU,PCMA,OPUSSIP domain (FQDN) the user registers on. Replaced by the vendor’s SIP domain unless it ends with the vendor’s host.
Example
acme.sip.siprtc.ioDisplay name of the SIP user: letters and digits only, at least 2 characters.
Example
ReceptionSIP digest password, at least 6 characters.
Example
S3cretPassw0rd!Prefix of the generated SIP username: 3 to 8 letters or digits. The username becomes the prefix followed by the current Unix time in milliseconds.
Example
acmeWhether presence is enabled for the user.
Example
falseWhether the SIP user may register and place calls.
Example
trueResponses
Section titled “ Responses ”The SIP user as provisioned on the registrar.
object
SIP domain the user registers on.
MD5 of username:domain:password, used for SIP digest authentication.
MD5 of username@domain:domain:password.
ID of the new SIP user; use it as endpoint_id.
SIP digest password as stored.
Generated SIP username (prefix plus a millisecond timestamp).
Example
{ "domain": "acme.sip.siprtc.io", "ha1": "0f1e2d3c4b5a69788796a5b4c3d2e1f0", "ha1b": "a1b2c3d4e5f60718293a4b5c6d7e8f90", "id": 5012, "password": "S3cretPassw0rd!", "username": "acme1768473000000"}A field failed validation (code 21213). When the gateway did not supply your company, the body is {status, message} with message “company id is empty” instead.
object
SIPRTC error code, for example 21213 (invalid field) or 20404 (not found).
Human-readable description of the error.
Link to more information.
HTTP status the error is meant to map to. It can differ from the actual response status.
Example
{ "code": 21213, "message": "validation failed on field Password is not valid", "more_info": "https://api.siprtc.io", "status": 400}Missing or wrong Basic-auth credentials (returned by the API gateway).
Example generated
exampleThe SIP user could not be stored (code 20404).
object
SIPRTC error code, for example 21213 (invalid field) or 20404 (not found).
Human-readable description of the error.
Link to more information.
HTTP status the error is meant to map to. It can differ from the actual response status.
Example
{ "code": 21213, "message": "validation failed on field Password is not valid", "more_info": "https://api.siprtc.io", "status": 400}