omnidesk
  • Ticket
    • Message
    • Using forms
    • Contact forms
  • Customers
    • General
    • API sync on contact
    • CSV import
    • API sync before contact
    • Customer lookup
  • Telephone
    • Callflow
    • Numbers
  • E-mail
  • Users
  • Live chat
    • Livechat chatbot and app integration (backend)
  • Facebook
  • Twitter
  • Survey
    • Push data
  • Statistics
    • Statistics API
  • Raw data - BI
  • Security policy
  • Hosting
  • API docs
    • General
    • Authentication
    • REST
  • API specification
    • Documentation for the Omnidesk API endpoints
    • Chat
    • Customer
    • Email
    • Form
    • Formfield
    • Message
    • Notification
    • Raw
    • Ticket
    • User
    • View
    • Statisticsv2
Powered by GitBook
On this page
  1. API specification

Statisticsv2

PreviousView

All the endpoints that can be called on the Statisticsv2 controller.

All the endpoints require the API_STATISTICS permission, except for:

  • POST dashboardDelete

  • PUT dashboard

Which require the DASHBOARD_CUD permission.

options

get

Returns the options available to the statistics showQuery and showData.

Authorizations
Responses
200Success
get
GET /api/v2/statisticsv2/options HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200Success

No content

dashboard

get

Returns all the dashboard data by the dashboard ID.

Authorizations
Query parameters
idnumberRequired
Responses
200Success
get
GET /api/v2/statisticsv2/dashboard?id=1 HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200Success

No content

dashboard

post

Creates a new dashboard.

Authorizations
Responses
200Success
post
POST /api/v2/statisticsv2/dashboard HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200Success

No content

dashboards

get

Returns all the dashboards.

Authorizations
Responses
200Success
get
GET /api/v2/statisticsv2/dashboards HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200Success

No content

widgetData

get

Returns all the data of this widget.

Authorizations
Query parameters
idnumberRequired
Responses
200Success
get
GET /api/v2/statisticsv2/widgetData?id=1 HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200Success

No content

showData

get

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.

Authorizations
Query parameters
filterUsers[]string · min: 1Optional

User to be filtered out.

filterUserID[]numberOptional

ID of the user to be filtered out.

nocachestringOptional

Disables caching if sent with request.

debugstringOptional

Enables debug mode and disables caching if sent with request.

panelIDnumberRequired

ID of the panel/widget.

Responses
200
showData example
application/json
get
GET /api/v2/statisticsv2/showData?panelID=1 HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200

showData example

{
  "item": {
    "buckets": [
      "2025-01-01",
      "2025-01-02",
      "2025-01-03",
      "2025-01-04",
      "2025-01-05",
      "2025-01-06",
      "2025-01-07"
    ],
    "facts": {
      "Tickets assigned": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "Tickets handled": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ]
    }
  },
  "type": "item"
}

widgetSendOptions

get

Returns the info on where this widget's data is being sent to.

Authorizations
Query parameters
idnumberRequired
Responses
200Success
get
GET /api/v2/statisticsv2/widgetSendOptions?id=1 HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200Success

No content

downloadData

get

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.

Authorizations
Query parameters
filterUsers[]string · min: 1Optional

User to be filtered out.

filterUserID[]numberOptional

ID of the user to be filtered out.

nocachestringOptional

Disables caching if sent with request.

debugstringOptional

Enables debug mode and disables caching if sent with request.

panelIDnumberRequired

ID of the panel/widget.

Responses
200
downloadData example
text/plain
get
GET /api/v2/statisticsv2/downloadData?panelID=1 HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Accept: */*
200

downloadData example

"Time"	"Tickets assigned"	"Tickets handled"
"2025-01-01"	"0"	"0"	

"2025-01-02"	"0"	"0"	

"2025-01-03"	"0"	"0"	

"2025-01-04"	"0"	"0"	

"2025-01-05"	"0"	"0"	

"2025-01-06"	"0"	"0"	

"2025-01-07"	"0"	"0"	

  • GEToptions
  • GETdashboard
  • POSTdashboard
  • PUTdashboard
  • POSTdashboardDelete
  • GETdashboards
  • GETwidgetData
  • GETshowData
  • POSTwidget
  • PUTwidget
  • POSTwidgetDelete
  • POSTwidgetPosition
  • PUTwidgetAutoRefresh
  • GETwidgetSendOptions
  • POSTwidgetSendOptions
  • GETdownloadData

dashboard

put

Updates this dashboard's name.

Authorizations
Body
idnumberRequired
namestring · min: 1OptionalDefault: ""Pattern: ^[0-9a-zA-Z\' :+*]+$
Responses
200Success
put
PUT /api/v2/statisticsv2/dashboard HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 18

"id=1&name=''"
200Success

No content

dashboardDelete

post

Deletes this dashboard and its widgets.

Authorizations
Body
idnumberRequired
Responses
200Success
post
POST /api/v2/statisticsv2/dashboardDelete HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 8

{
  "id": 1
}
200Success

No content

widget

post

Creates a new widget.

See the example for how to write the dataURL.

Authorizations
Body
dashboardIDnumberRequired
titlestring · min: 1OptionalDefault: ""Pattern: ^[0-9a-zA-Z :+*\-]+$
dataURLstring · min: 1Optional

Identical to the way showData allows these requested parameters in the URL.

Default: ""Pattern: ^[a-zA-Z0-9\.\:\/\-\ \=\?\&\[\]\_\:\+\*\@]+$
viewTypestring · min: 1OptionalDefault: tablePattern: ^([a-zA-Z]+)$
fontSizeTitlenumberOptional
fontSizeDatanumberOptional
pivotOnColumnnumberOptionalDefault: 0
ticketArchivedbooleanOptionalDefault: false
position_xnumberOptionalDefault: 0
position_ynumberOptionalDefault: 0
widthnumberOptionalDefault: 5
heightnumberOptionalDefault: 5
Responses
200
widget example
application/json
post
POST /api/v2/statisticsv2/widget HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 187

{
  "dashboardID": 1,
  "title": "",
  "dataURL": "",
  "viewType": "table",
  "fontSizeTitle": 1,
  "fontSizeData": 1,
  "pivotOnColumn": 0,
  "ticketArchived": false,
  "position_x": 0,
  "position_y": 0,
  "width": 5,
  "height": 5
}
200

widget example

{
  "item": {
    "widgetID": 10
  },
  "type": "item"
}

widget

put

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.

Authorizations
Body
idnumberRequired
titlestring · min: 1OptionalDefault: ""Pattern: ^[0-9a-zA-Z :+*\-]+$
dataURLstring · min: 1OptionalDefault: ""Pattern: ^[a-zA-Z0-9\.\:\/\-\ \=\?\&\[\]\_\:\+\*\@]+$
viewTypestring · min: 1OptionalDefault: tablePattern: ^([a-zA-Z]+)$
fontSizeTitlenumberOptional
fontSizeDatanumberOptional
pivotOnColumnnumberOptionalDefault: 0
ticketArchivedbooleanOptionalDefault: false
Responses
200
widget example
application/json
put
PUT /api/v2/statisticsv2/widget HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 208

"dataURL='facts[]=ticketIncoming&factTitleticketIncoming=&groupBy[]=timeHour&filters[]=timeRelativeToday&font_size_title=12&font_size_data=10&pivot_on_column=0'&fontSizeData=10&fontSizeTitle=12&id=10"
200

widget example

{
  "message": "Widget saved.",
  "status": "success",
  "type": "result"
}

widgetDelete

post

Deletes this widget.

Authorizations
Body
idnumberRequired
Responses
200Success
post
POST /api/v2/statisticsv2/widgetDelete HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 8

{
  "id": 1
}
200Success

No content

widgetPosition

post

Updates this widget's position.

Authorizations
Body
idnumberRequired
widthnumberOptional
heightnumberOptional
xnumberOptional
ynumberOptional
Responses
200Success
post
POST /api/v2/statisticsv2/widgetPosition HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 41

{
  "id": 1,
  "width": 1,
  "height": 1,
  "x": 1,
  "y": 1
}
200Success

No content

widgetAutoRefresh

put

Sets the setting to automatically refresh this widget on or off.

Authorizations
Body
idnumberRequired
statenumber · max: 1Required
Responses
200Success
put
PUT /api/v2/statisticsv2/widgetAutoRefresh HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 18

"id=1&state=1"
200Success

No content

widgetSendOptions

post

Creates a setting to send all widget data to an email.

Authorizations
Body
idnumberRequired
sendFrequencystring · min: 1Required

The interval you want to send at.

Pattern: ^([0-9a-zA-Z\ \:\*]+)$
toAddressesstring · min: 4 · max: 500Optional

Has to be an email address or multiple email addresses comma-separated

Default: ""Pattern: ^([a-zA-Z0-9 @+-_.,]+)$
Responses
200Success
post
POST /api/v2/statisticsv2/widgetSendOptions HTTP/1.1
Host: {{base_url}}
apiKey: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 48

{
  "id": 1,
  "sendFrequency": "text",
  "toAddresses": ""
}
200Success

No content