Cention Logio (login & logout) API
- To use Cention Contact Center logio API, a Bearer Token with ‘Access to logio API’ claim is needed (see steps and Screenshot below).
- To create Bearer Token, go to Cention server → Administration tab → API → Access Tokens.
- Click on Create New button and tick the checkbox beside ‘Access to logio API’ under Others.
- Fill up the required Name & Key fields or otherwise the Save button will not be clickable.
The API could be called from any web agent with Bearer Token in the http header: Authorization: Bearer <token>
. For example Authorization: Bearer eyJhbGci...<snip>...yu5CSpyHI
- Use HTTP GET with endpoint:
https://<cention api domain>/s/<workspace>/capi/custom/logio
to call logio API. If the name of your Cention workspace is “demo” and the cention api domain is apid.cention.com then the endpoint would be:https://apid.cention.com/s/demo/capi/custom/logio
Field | Description |
---|---|
name | Login name of an agent for retrieval, default (if not specified) is to retrieve records for all agents. |
format | Output format of an export, available choices are csv and json; default (if not specified) is to use csv format. |
from | Timestamp of records to be retrieved in unix format; default (if not specified) is to retrieve records from last 7 days. |
to | Timestamp of records to be retrieved in unix format; default (if not specified) is to use current timestamp. |
- A query without parameter will retrieve last 7 days of login and logout records for all agents within a system group (which the Bearer Token was created), in csv format.
curl -H "Authorization: Bearer <token>" "https://<cention api domain>/s/<workspace>/capi/custom/logio"
- Use name (login name) parameter to retrieve login and logout records for a specific agent.
curl -H "Authorization: Bearer <token>" \
"https://<cention api domain>/s/<workspace>/capi/custom/logio?name=joe"
- Use format parameter to retrieve login and logout records in specific format, current supported formats are csv and json.
curl -H "Authorization: Bearer <token>" \
"https://<cention api domain>/s/<workspace>/capi/custom/logio?format=csv"
- Use from and to parameter to retrieve login and logout records within a specific time frame, these parameters are in unix timestampt format.
curl -H "Authorization: Bearer <token>" \
"https://<cention api domain>/s/<workspace>/capi/custom/logio?from=1554857192&to=1555980452"
- Parameters could be combined into a single query, e.g. the following will retrieve login and logout records ranged between 1554857192 and 1555980452 for agent sysadmin, in csv format.
curl -H "Authorization: Bearer <token>" \
"https://<cention api domain>/s/<workspace>/capi/custom/logio?from=1554857192&to=1555980452&name=sysadmin&format=csv"
Field | Description |
---|---|
id | Running number of the retrieved login/logout records. |
name | Login name of an agent |
timestamp | Timestamp of login or logout action |
action | Login or Logout |
- csv (headerless, unix new line format)
1,sysadmin,1554108462,Logout
2,tester1,1554108529,Logout
3,sysadmin,1554108536,Login
4,sysadmin,1554108578,Logout
5,tester1,1554108586,Login
- json (there will be no line break between records in actual response)
[{"id":1,"name":"sysadmin","timestamp":1554108462,"action":"Logout"},
{"id":2,"name":"tester1","timestamp":1554108529,"action":"Logout"},
{"id":3,"name":"sysadmin","timestamp":1554108536,"action":"Login"},
{"id":4,"name":"sysadmin","timestamp":1554108578,"action":"Logout"},
{"id":5,"name":"tester1","timestamp":1554108586,"action":"Login"}]
-
For security reason, logio will retrieve records within same system group; meaning if the API was created in system group A, the retrieval will pull records within system group A only.
-
Convertion between unix timestamp and human readable format could be done programatically or via online, e.g. epochconverter.