REST API Examples¶
CURL Examples (xivo-confd)¶
# Get the list of users
curl --insecure \
-H 'Accept: application/json' \
-H 'X-Auth-Token: 17496bfa-4653-9d9d-92aa-17def0fa9826' \
https://wazo:9486/1.1/users
# Create a user
# When sending data, you need the Content-Type header.
curl --insecure \
-X POST \
-d '{"firstname": "hello-world"} \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'X-Auth-Token: 17496bfa-4653-9d9d-92aa-17def0fa9826' \
https://wazo:9486/1.1/users
Create a user with a phone and a voicemail (xivo-confd)¶

Create a line:
POST /lines/sip { "context": "default" }
Response:
{ "id": 11 ... }
Create an extension:
POST /extensions { "exten": "1234", "context": "default" }
Response:
{ "id": 22 ... }
Associate the line-extension:
PUT /lines/11/extensions/22
Create a user:
POST /users { "firstname": "Alice" }
Response:
{ "uuid": "44444444-4444-4444-4444-444444444444" ... }
Associate the user-line:
PUT /users/44444444-4444-4444-4444-444444444444/lines/11
Create the SIP endpoint:
POST /endpoints/sip { }
Response:
{ "id": 66 ... }
Associate the line-endpoint:
PUT /lines/11/endpoints/sip/66
Create the device. This is usually done automatically when the device is plugged in and put in autoprov mode. However, you need to get the device ID:
GET /devices?search=88:88:88:88:88:88 or GET /devices?search=192.168.88.88 { "id": "88888888888888888888888888888888", ... }
Associate the line-device:
PUT /lines/11/devices/88888888888888888888888888888888
You may also want to re-synchronize the device:
PUT /devices/88888888888888888888888888888888/synchronize
Create the voicemail:
POST /voicemails { "name": "Alice's voicemail", "number": "1234" "context": "default" }
Response:
{ "id": 1010 ... }
Associate the user-voicemail:
PUT /users/44444444-4444-4444-4444-444444444444/voicemails/1010