The complete API is defined as a public Postman Workspace, which can be found here
The steps to obtain the API Token key and examples of using the API via curl are below, but we highly recommend using Postman for testing the API.
Your token was provided to you after you installed dSIPRouter. You can reset your token if you didn't write it down, by executing the following command
DSIP_HOSTNAME=<your ip or hostname>
DSIP_TOKEN=<your token>
dsiprouter setcredentials -ac $DSIP_TOKEN
curl -k -H "Authorization: Bearer $DSIP_TOKEN" -X GET https://$DSIP_HOSTNAME:5000/api/v1/kamailio/stats
Create a new endpoint lease
curl -k -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X GET "https://$DSIP_HOSTNAME:5000/api/v1/endpoint/lease?ttl=15&email=mack@dsiprouter.org"
Revoking and replacing with your own lease ID
curl -k -H "Authorization: Bearer $DSIP_TOKEN" -H "Content-Type: application/json" -X PUT "https://$DSIP_HOSTNAME:5000/api/v1/endpoint/lease/1/revoke"
All available routes are documented in the routes documentation <../routes/index>
.