REST API

Initial Login

Initiate an HTTP PUT Request to the server from the application with the User’s Login credentials of the PBX.

You will need admin credentials to your PBX (username and password) as well as the domain.

 

Generating the Login Key

To generate the login key, you will need to provide the username followed by the MD5 hash of the password. Seperate by a space.

For example, username: test and password:  mypass1 would be:

“test 9094780eedd68eae55f4dafc02dfa3fc”

The login key needs to be sent in your request below (see Cookie)

 

Request:

PUT /rest/system/session
HTTP/1.1 Host: test12345.pbx1.mel.0101.net.au
Connection: keep-alive
Content-Length: 65
Origin: http://myserver.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36
Content-Type: application/json Accept: */*
DNT: 1
Referer: http://myserver.com/welcome.htm
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cookie: acct_table#pageNavPos=1 {“name”:”auth”,”value”:”admin 97c9bb5fec29bfbfbd0069adb232d610″}

Response:

Response from PBX contains the Session key to be used in subsequent messages
HTTP/1.1 200 Ok
Cache-Control: no-cache
Content-Type: application/json
Content-Length: 22

g7lsrphhrkim1jkvbt88

You will need to store this session key for future API calls.

Get ACD Information

Send GET in the following format. You will need to know:

Username of the requesting user (e.g. test)
Hostname of the PBX Domain (e.g. test12345)
ACD Queue Number (e.g. 60)
Session Key – to be provided in the Cookie section (see above Login info)

 

Request:

GET /rest/user/test%40test12345.pbx1.mel.0101.net.au/wallboard/60 HTTP/1.1
Host: pbx1.mel.0101.net.au
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36
Accept: */*
Referer: http://pbx3.mel.0101.net.au/usr_index.htm
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-GB,en-US;q=0.8,en;q=0.6
Cookie: session=g7lsrphhrkim1jkvbt88;

 

Response:

HTTP/1.1 200 Ok
Cache-Control: no-cache
Content-Type: application/json
Content-Length: 4019

{"acds":{"60":{"redirect":{"waiting":0,"ringing":0,"anonymous":0},"hangup":{"waiting":0,"ringing":0},"exit":{"user":0,"application":0,"other":0},"duration":{"sum":{"ivr":0,"ring":0,"talk":0,"hold":0,"idle":0},"average":{"ivr":0,"ring":0,"talk":0,"hold":0,"idle":0}},"calls":{"count":0,"completed":0}}},"logged_agents":[315,308,314,302,304,310,311,309,313,307,306,305,301,312],"agents":[{"account":"315","name":"Alex Marsh","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"301","name":"Brock Anderson","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"302","name":"Callum Raymond","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"303","name":"Corey Sanders","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"304","name":"Jason Grigg","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"305","name":"Jordy Savill","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[[1462406728.722,1462406734.277]]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"306","name":"Joseph Purchase","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"307","name":"Rick Morris","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"308","name":"Sam Miller","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"309","name":"Tom Gilmore","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[[1462370400.0,1462406865.461]]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"310","name":"Marissa Vitasovich","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"311","name":"Roshni Schiemer","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"312","name":"Tom Mckinlay","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"313","name":"Emily Cooke","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}},{"account":"314","name":"Sarah Jane Tewhare","dnd":false,"work":{"begin":1462370400.0,"end":1462456800.0,"now":1462426562.368,"segments":[[1462370400.0,1462406509.654],[1462406524.188,1462406530.927],[1462406598.285,1462406618.452],[1462406633.94,1462406865.882],[1462406963.423,1462407448.738]]},"calls":0,"duration":{"talk":0,"hold":0,"idle":0},"average":{"talk":0,"hold":0,"idle":0}}],"current":[],"history":[]}

 

{acds: {60: {redirect: {waiting: 0, ringing: 0, anonymous: 0}, hangup: {waiting: 0, ringing: 0},…}},…}

acds:{60: {redirect: {waiting: 0, ringing: 0, anonymous: 0}, hangup: {waiting: 0, ringing: 0},…}}

60:{redirect: {waiting: 0, ringing: 0, anonymous: 0}, hangup: {waiting: 0, ringing: 0},…}

agents:[{account: “315”, name: “Alex Marsh”, dnd: false,…},…]

0:{account: “315”, name: “Alex Marsh”, dnd: false,…}

1:{account: “301”, name: “Brock Anderson”, dnd: false,…}

2:{account: “302”, name: “Callum Raymond”, dnd: false,…}

3:{account: “303”, name: “Corey Sanders”, dnd: false,…}

4:{account: “304”, name: “Jason Grigg”, dnd: false,…}

5:{account: “305”, name: “Jordy Savill”, dnd: false,…}

6:{account: “306”, name: “Joseph Purchase”, dnd: false,…}

7:{account: “307”, name: “Rick Morris”, dnd: false,…}

8:{account: “308”, name: “Sam Miller”, dnd: false,…}

9:{account: “309”, name: “Tom Gilmore”, dnd: false,…}

10:{account: “310”, name: “Marissa Vitasovich”, dnd: false,…}

11:{account: “311”, name: “Roshni Schiemer”, dnd: false,…}

12:{account: “312”, name: “Tom Mckinlay”, dnd: false,…}

13:{account: “313”, name: “Emily Cooke”, dnd: false,…}

14:{account: “314”, name: “Sarah Jane Tewhare”, dnd: false,…}

current:[]

history:[]

logged_agents:[315, 308, 314, 302, 304, 310, 311, 309, 313, 307, 306, 305, 301, 312]

0:315

1:308

2:314

3:302

4:304

5:310

6:311

7:309

8:313

9:307

10:306

11:305

12:301

13:312