Sipfront API¶
Sipfront provides a REST API to programmatically control various aspects of the platform.
Data Format¶
To send data to the API, use form-encoded request bodies. The API responds with JSON data and standard HTTP response codes.
Authentication¶
Authentication on the API is performed using Basic Authentication over HTTPS.
Info
You can create your own API key here: Sipfront API Keys.
Note
Note that the secret key is only revealed once, so if you lose it, you have to issue a new pair of keys.
Test steps¶
When performing tests on the API, you have to understand how these tests are structured (in fact it's the same on the Web UI, but there it's graphically abstracted).
Tests go through one or more steps, each containing one or more actions. The notion for these steps and actions is by addressing them with the prefix step.$step_index.$action_index
, for instance step.0.0
to address attributes for the first action in the first step.
The figure below outlines an example test for a basic call with two steps. The first step is to prepare the called party by registering the users in the first action of this step, then wait for inbound calls as second action of this step. The second step is to start initiating calls from the calling party to these called parties that we have prepared in the previous step.
In order to set the expire value of the called parties to one hour when registering them in the first action of the first step, you would provide the attribute step.0.0.regexpire=3600
. To initiate exactly 10 new calls from the calling parties to the called parties in the first action of the second step, you would set step.1.0.max_total_calls=10
.
Examples¶
Explore endpoints¶
#!/bin/sh
AUTH="$public_key:$secret"
curl -X GET \
-u "$AUTH" \
https://app.sipfront.com/api/v2/ | jq .
echo
Explore available tests and their parameters¶
#!/bin/sh
AUTH="$public_key:$secret"
curl -X GET \
-u "$AUTH" \
https://app.sipfront.com/api/v2/tests | jq .
echo
Run specific test¶
Info
The test must be configured in the Sipfront UI.
#!/bin/sh
AUTH="$public_key:$secret"
curl https://app.sipfront.com/api/v2/tests/run \
-X POST \
-u "$AUTH" \
-d test.name=$your_test_name \
-d report.mode="kiosk" \
-d step.1.0.dial_destination="431231234"