Connecting Grafana to 3CX documentation

Grafana Cloud or Grafana on-premise
Using WebAPI, Grafana makes POST requests to the 3CX database using the standard port (default is 5001). The received data in JSON format is used to display reports and dashboards.
You need to have a WebAPI & Webhook bundle license to use Grafana 3CX connection.
1
Add Data source JSON API
Specify https://{{3CXFQDN}}/webapi/{{AccessKey}}/ as HTTP URL
2
Add Visualization panel to a dashboard
Specify POST /query as a path. Set cache time = 0s
3
Specify a POST JSON request as a body
e.g. {"query":"SELECT * FROM public.call_history_view where segment_start_time >= '${__from:date}' and segment_start_time <= '${__to:date}';",
"count":"100"
}
4
Specify a $.result[*][0], $.result[*][1]... as a JSONPath fields
You can specify as many fields as columns your request contains
5
For using variables add Query Type and use a similar connection scheme.
For using variable in panel use where Ext = ANY('{${Extension:raw}}')
6