Statisticsv2
All the endpoints that can be called on the Statisticsv2 controller.
All the endpoints require the API_STATISTICS permission, except for:
POSTdashboardDeletePUTdashboard
Which require the DASHBOARD_CUD permission.
Returns the options available to the statistics showQuery and showData.
Successful response
GET /api/v2/statisticsv2/options HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Accept: */*
Successful response
Returns all the dashboard data by the dashboard ID.
Successful response
GET /api/v2/statisticsv2/dashboard HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Accept: */*
Successful response
Updates this dashboard's name.
type: number
The dashboard's ID.
type: ^[0-9a-zA-Z\' :+*]+$ = ' '
Successful response
PUT /api/v2/statisticsv2/dashboard HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 27
"id='text'&name='text'"Successful response
Deletes this dashboard and its widgets.
type: number
Successful response
POST /api/v2/statisticsv2/dashboardDelete HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 13
{
"id": "text"
}Successful response
Returns all data of this widget to show.
Widget data specifics can be added how is shown in the example. Adjust to your own needs.
OK
GET /api/v2/statisticsv2/showData HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Accept: */*
OK
{
"type": "item",
"item": {
"buckets": [
"2024-08-26",
"2024-08-27",
"2024-08-28",
"2024-08-29",
"2024-08-30",
"2024-08-31",
"2024-09-01"
],
"facts": {
"Tickets assigned": [
0,
0,
0,
0,
0,
0,
0
],
"Tickets handled": [
0,
0,
0,
0,
0,
0,
0
]
}
}
}Creates a new widget.
See the example for how to write the dataURL.
type: number
type: ^[0-9a-zA-Z :+*\-]+$ = ' '
type: ^[a-zA-Z0-9\.\:\/\-\ \=\?\&\[\]\_\:\+\*\@]+$ = ' '
Identical to the way showData allows these requested paramters in the URL.
type: ^([a-zA-Z]+)$ = 'table'
type: number = null
type: number = null
type: ^([0-9]+)$ = 0
type: boolean = false
type: number = 0
type: number = 0
type: number = 5
type: number = 5
OK
POST /api/v2/statisticsv2/widget HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 235
{
"dashboardID": "text",
"title": "text",
"dataURL": "text",
"viewType": "text",
"fontSizeTitle": "text",
"fontSizeData": "text",
"pivotOnColumn": "text",
"ticketArchived": "text",
"position_x": "text",
"position_y": "text",
"width": "text",
"height": "text"
}OK
{
"type": "item",
"item": {
"widgetID": 10
}
}Updates an existing widget.
See the example for how to write the dataURL. You need to fill in all the data, not just the changed data.
type: number
type: ^[0-9a-zA-Z :+*\-]+$ = ' '
type: ^[a-zA-Z0-9\.\:\/\-\ \=\?\&\[\]\_\:\+\*\@]+$ = ' '
type: ^([a-zA-Z]+)$ = 'table'
type: number = null
type: number = null
type: number = 0
type: boolean = false
OK
PUT /api/v2/statisticsv2/widget HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 155
"id='text'&title='text'&dataURL='text'&viewType='text'&fontSizeTitle='text'&fontSizeData='text'&pivotOnColumn='text'&ticketArchived='text'"OK
{
"type": "result",
"status": "success",
"message": "Widget saved."
}Deletes this widget.
type: number
Successful response
POST /api/v2/statisticsv2/widgetDelete HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 13
{
"id": "text"
}Successful response
Updates this widget's position.
type: number
type: number = null
type: number = null
type: number = null
type: number = null
Successful response
POST /api/v2/statisticsv2/widgetPosition HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 66
{
"id": "text",
"width": "text",
"height": "text",
"x": "text",
"y": "text"
}Successful response
Sets the setting to automatically refresh this widget on or off.
type: number
type: ^(0|1)$
Successful response
PUT /api/v2/statisticsv2/widgetAutoRefresh HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 28
"id='text'&state='text'"Successful response
Returns the info on where this widget's data is being sent to.
Successful response
GET /api/v2/statisticsv2/widgetSendOptions HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Accept: */*
Successful response
Creates a setting to send all widget data to an email.
type: number
type: ^([0-9a-zA-Z\ \: \*]+)$
Set for if you want to send it with a regular interval.
type: ^([a-zA-Z0-9 @+-_.,]+)$
Has to be an email address or multiple email addresses comma-separated
Successful response
POST /api/v2/statisticsv2/widgetSendOptions HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Content-Type: multipart/form-data
Accept: */*
Content-Length: 57
{
"id": "text",
"sendFrequency": "text",
"toAddresses": "text"
}Successful response
Returns and downloads all data of this widget, or of the data you sent along with the request.
You either need to send the widget/panel ID, or the data in such a way provided in the example.
OK
GET /api/v2/statisticsv2/downloadData HTTP/1.1
Host: {{base_url}}
Authorization: apikey YOUR_SECRET_TOKEN
Accept: */*
OK
"Time" "Tickets assigned" "Tickets handled"
"2024-08-26" "0" "0"
"2024-08-27" "0" "0"
"2024-08-28" "0" "0"
"2024-08-29" "0" "0"
"2024-08-30" "0" "0"
"2024-08-31" "0" "0"
"2024-09-01" "0" "0"
Last updated