API
Thirdlane REST API
Thirdlane provides REST API that allows you to create and manage various objects.
Thirdlane API uses HTTP verbs and a REST endpoint structure. Basic Authentication is used as the API Authorization framework. Request and response payloads are formatted as JSON.
What Can You Do with Thirdlane REST API
Thirdlane API allows you to create, update and delete various objects, and covers the following:
- Tenant Management
- DID Management
- Inbound Routes Management
- User Extensions Management
- User Extension's Settings Management
- Access to Call History
- Personal Contacts Management
- Company Contacts Management
- Voicemail Management
- Conference Management
- Tenant Administrators Management
- Hunt Lists Management
- Pickup Groups Management
- Query CRM Records
- Contact Source Management
How to try Thirdlane REST API
The API screen in Configuration Manager provides you with an easy and convenient way to learn and try Thirdlane REST API. Here are the API for managing Tenants
Here is an example of API for retrieving a list of Tenants:
Note that username and password are required for Basic Authentication. Credentials have to be only entered once and all the subsequent operations will use access permissions based on the authenticated user until new user credentials are entered.
Note that the auto-generated sample curl commands on the page above add --insecure option that allows you to try the API without a domain with a real certificate. You should not use this option in production environment.
Here is an example of API for adding a Tenant:
Here is an example of API for adding a User Extension:
How to use Thirdlane REST API
You can use Thirdlane REST API from applications written in any language capable of submitting HTTP requests and processing JSON. Here are a few examples using curl command line tool.
Curl Example to List Tenants
This example will list all the Tenants the user "username" has permission to access.
curl https://yourhost.yourdomain.com/api/tenants/ -P GET --user username:password
Curl Example to Add a Tenant
This example will create a Tenant "test1000" and copy settings for limits (allowed numbers of various objects), routes (Outbound Routes), schedules (Time Range Groups), menus (IVR/Voice Menus), queues (Queues), and voice prompts (Voice Prompts from a Tenant "thirdlane". This assumes that the user "username" has permission to create Tenants.
curl https://yourhost.yourdomain.com/api/tenants/ -P POST --user username:password --data-binary '{
"tenant":"test1000",
"callerid":"14155551212",
"emergency_callerid":"14155551313",
"tenant_to_clone":"thirdlane",
"tenant_limits":"1",
"tenant_routes":"1",
"tenant_schedules":"1",
"tenant_menus":"1",
"tenant_queues":"1",
"tenant_voiceprompts":"1",
"description":"Test tenant"
}'
Curl Example to Add a User Extension
This example will create a User Extension "201" for Tenant "thirdlane".
curl https://yourhost.yourdomain.com/api/tenants/thirdlane/extensions/ -P POST --user username:password --data-binary '
{"ext":201,
"protocol":"SIP",
"last_name":"Last",
"first_name":"First",
"email_address":"test@dot.net"
}'