API-V2

Extensions

The current collection shows all the methods available to get or put extensions information.

AUTHORIZATION Bearer Token

GET /extensions

http://{{host}}/api/v2/extensions

Get all extensions and its devices from the PBX filtered by tenant.

AUTHORIZATION Bearer Token

This request is using Bearer Token from folder Extensions.

HEADERS

app-key {{api-key}}
Application key to authenticate requests
tenant {{tenant}}
Filter by tenant
Example Request
/extensions
GET /api/v2/extensions HTTP/1.1
Host: {{host}}
app-key: {{api-key}}
tenant: {{tenant}}
Example Response
200 OK
{
  "status": "success",
  "data": [
    {
      "extension_id": 1,
      "extension": "100",
      "name": "Jhone Doe",
      "language": "en",
      "email": null,
      "class_of_service_id": 1,
      "dial_profile_id": 1,
      "call_limit": 0,
      "internal_cid": "\"Jhone Doe\" <100>",
      "external_cid": "\"Jhone Doe\" <100>",
      "emergency_cid": "\"Jhone Doe\" <100>",
      "ringtime": 0,
      "nospy": false,
      "enabled_pa": false,
      "answermode": "disable",
      "mailbox": "100@vitalpbx-voicemail",
      "accountcode": null,
      "features_password": "*56437",
      "sendcid": false,
      "generate_hints": false,
      "hot_desking": false,
      "secretary": null,
      "music_group_id": 2,
      "rec_on_demand": false,
      "internal_rec": true,
      "outgoing_rec": true,
      "incoming_rec": true,
      "dictate_enable": false,
      "dictate_format": "ogg",
      "dictate_auto_send": false,
      "fax_enabled": false,
      "fax_auto_send": false,
      "absent_secretary": false,
      "lock": false,
      "call_waiting": false,
      "pinless": false,
      "dynamic_routing": false,
      "tenant_id": 1,
      "context": "cos-all",
      "has_analog_devices": false,
      "devices": [
        {
          "device_id": "3",
          "extension_id": "3",
          "profile_id": "1",
          "user": "100",
          "secret": "100",
          "description": "Jhone Doe",
          "ring_device": "yes",
          "technology": "sip",
          "assigned_exten": "100",
          "tenant_id": "1",
          "device_name": "100"
        }
      ],
      "queues_info": {
        "queues": [
          1
        ],
        "queues_name": [
          "Q500"
        ],
        "queues_penalty": [
          "0"
        ]
      }
    }
  ]
}
Date: Tue, 28 May 2019 18:23:01 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json

 

GET /extensions/{id}

http://{{host}}/api/v2/extensions/{{extension-id}}

Get specific extension from server filtered by extension id.

AUTHORIZATION Bearer Token

This request is using Bearer Token from folder Extensions

HEADERS

app-key {{api-key}}
Application key to authenticate requests
tenant {{tenant}}
Filter by tenant
Example Request
/extensions
GET /api/v2/extensions HTTP/1.1
Host: {{host}}
app-key: {{api-key}}
tenant: {{tenant}}
Example Response
200 OK
{
  "status": "success",
  "data": [
    {
      "extension_id": 1,
      "extension": "100",
      "name": "Jhone Doe",
      "language": "en",
      "email": null,
      "class_of_service_id": 1,
      "dial_profile_id": 1,
      "call_limit": 0,
      "internal_cid": "\"Jhone Doe\" <100>",
      "external_cid": "\"Jhone Doe\" <100>",
      "emergency_cid": "\"Jhone Doe\" <100>",
      "ringtime": 0,
      "nospy": false,
      "enabled_pa": false,
      "answermode": "disable",
      "mailbox": "100@vitalpbx-voicemail",
      "accountcode": null,
      "features_password": "*56437",
      "sendcid": false,
      "generate_hints": false,
      "hot_desking": false,
      "secretary": null,
      "music_group_id": 2,
      "rec_on_demand": false,
      "internal_rec": true,
      "outgoing_rec": true,
      "incoming_rec": true,
      "dictate_enable": false,
      "dictate_format": "ogg",
      "dictate_auto_send": false,
      "fax_enabled": false,
      "fax_auto_send": false,
      "absent_secretary": false,
      "lock": false,
      "call_waiting": false,
      "pinless": false,
      "dynamic_routing": false,
      "tenant_id": 1,
      "context": "cos-all",
      "has_analog_devices": false,
      "devices": [
        {
          "device_id": "3",
          "extension_id": "3",
          "profile_id": "1",
          "user": "100",
          "secret": "100",
          "description": "Jhone Doe",
          "ring_device": "yes",
          "technology": "sip",
          "assigned_exten": "100",
          "tenant_id": "1",
          "device_name": "100"
        }
      ],
      "queues_info": {
        "queues": [
          1
        ],
        "queues_name": [
          "Q500"
        ],
        "queues_penalty": [
          "0"
        ]
      }
    }
  ]
}
Date: Tue, 28 May 2019 18:23:01 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: application/json

 

GET /extensions/{id}/devices

http://{{host}}/api/v2/extensions/{{extension-id}}/devices

Retrive all devices for a specific extension

AUTHORIZATION Bearer Token

This request is using Bearer Token from folder Extensions

HEADERS

app-key {{api-key}}
tenant {{tenant}}
Example Request
200 – Devices retrieve
GET /api/v2/extensions/{{extension-id}}/devices HTTP/1.1
Host: {{host}}
app-key: {{api-key}}
tenant: {{tenant}}
Example Response
200 OK
{
  "status": "success",
  "message": null,
  "data": [
    {
      "device_id": "2",
      "extension_id": "2",
      "profile_id": "1",
      "user": "dev-101",
      "secret": "QG4nKqN#BQnNzu",
      "description": "Agent 01",
      "ring_device": "yes",
      "technology": "sip",
      "assigned_exten": null,
      "tenant_id": "1",
      "device_name": "dev-101"
    }
  ]
}
Date: Fri, 29 Nov 2019 23:19:01 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Length: 267
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json

 

GET /extensions/{id}/queues

http://{{host}}/api/v2/extensions/{{extension-id}}/queues

Retrive queues info for an specific extension

AUTHORIZATION Bearer Token

This request is using Bearer Token from folder Extensions

HEADERS

app-key {{api-key}}
tenant {{tenant}}
Example Request
200 – Queues Info Retrieved
GET /api/v2/extensions/{{extension-id}}/queues HTTP/1.1
Host: {{host}}
app-key: {{api-key}}
tenant: {{tenant}}
Example Response
200 OK
{
  "status": "success",
  "message": null,
  "data": {
    "queues_id": [
      1,
      2
    ],
    "queues_name": [
      "Q500",
      "Q501"
    ],
    "queues_penalty": [
      "0",
      "0"
    ]
  }
}
Date: Fri, 29 Nov 2019 23:15:43 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Length: 119
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json

 

GET /extensions/{id}/cdr_summary

http://{{host}}/api/v2/extensions/{{extension-id}}/cdr_summary

Get cdr summary from a specific extension

AUTHORIZATION Bearer Token

This request is using Bearer Token from folder Extensions

HEADERS

app-key {{api-key}}
tenant {{tenant}}
Example Request
200 – CDR Summary
GET /api/v2/extensions/{{extension-id}}/cdr_summary HTTP/1.1
Host: {{host}}
app-key: {{api-key}}
tenant: {{tenant}}
Example Response
200 OK
{
  "status": "success",
  "data": {
    "local": "45",
    "incoming": "29",
    "outgoing": "4",
    "transit": "0"
  }
}
Date: Wed, 29 May 2019 16:54:22 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Length: 176
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json

 

GET /extensions/{id}/voicemail_records

http://{{host}}/api/v2/extensions/{{extension-id}}/voicemail_records

Return all the voicemail records for an specific extension

AUTHORIZATION Bearer Token

This request is using Bearer Token from folder Extensions

HEADERS

app-key {{api-key}}
tenant {{tenant}}
Example Request
200 – Voicemail Recordings
GET /api/v2/extensions/{{extension-id}}/voicemail_records HTTP/1.1
Host: {{host}}
app-key: {{api-key}}
tenant: {{tenant}}
Example Response
200 OK
{
  "status": "success",
  "data": {
    "INBOX": {
      "date": "1565987730",
      "clid": "Demo<1519>",
      "priority": "2",
      "vmorig": "2000",
      "duration": "9",
      "recfile": "/static/43b4298b09648469/voicemail/2000/INBOX/msg0000.wav",
      "filename": "msg0000.txt"
    },
    "Old": {
      "date": "1513443087",
      "clid": "X-Lite<7502>",
      "priority": "2",
      "vmorig": "2000",
      "duration": "8",
      "recfile": "/static/43b4298b09648469/voicemail/2000/Old/msg0000.wav",
      "filename": "msg0000.txt"
    }
  }
}
Date: Fri, 16 Aug 2019 20:48:20 GMT
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
X-Powered-By: PHP/5.4.16
Content-Length: 421
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/json

 

Voicemail