Reports
Use Bold360 reporting API calls to analyze and interpret the underlying data associated with site engagements and facilitate the transformation of data into actionable information.
To retrieve reports, you must first generate the report with the runReport API call and then retrieve the generated report with the getReport call. The runReport call returns a ReportID value which must be passed as a parameter to the getReport method to retrieve the report data.
runReport
Starts generating a report; however, this method does not return report data. Report generation is run asynchronously, so you must call getReport to check the report status.
Sample code
https://api.boldchat.com/aid/{accountID}/data/rest/json/v1/runReport?auth={authentication hash}&ReportType=0&Grouping=chat_type&FromDate=2017-11-05T08:15:30-05:00&ToDate=2018-03-05T08:15:30-05:00
Response
{
"Status": "success",
"Data": {
"ReportID": "874869657849833579"
}
}
getReport
Retrieves report data if it is available.
Parameter | Type | Required | Description |
---|---|---|---|
ReportID | string id | yes | The report you want to retrieve. This report id must be the one returned in the call to runReport. |
Sample code
https://api.boldchat.com/aid/{accountID}/data/rest/json/v1/getReport?auth={authentication hash}&ReportID=874869657849833579
Response
{
"Status": "success",
"Data": { [...],
},
"StatusCode": 4
}
Reports require time to be generated and cannot be immediately acquired. Depending on the generation status, the following codes are returned:
Code | Status | Description |
---|---|---|
0-3 | Running | The report is being generated. |
4 | Success | The report is successfully generated. |
5 | Timeout | The report took too long to generate. |
6 | Error | The report failed to generate. |
7 | Cancel | Report generation has been cancelled. |