businessreports/reports/{id}/create
Produces an Excel report for the given report ID.
This operation is asynchronous. This means you submit your request and then need to poll the operation ID until completion. Then you can download the Excel (or other report format).
URL
(POST) /businessreports/reports/{id}/create
PARAMETERS
URL parameters are:
id | The unique ID of the report. To get a list of all reports use: businessreports/list A default report is prefixed "S" such as in "S500". A custom report is prefixed with "C" such as in "C1002" | string, Mandatory |
The body must contain a JSON object with these properties:
uioption | Optional. Some reports propose an option to tune the contents: Sorting of results, date filter criteria and more. In order to understand which options (if any) are available for the report you want to create, proceed as follows:
Example:
CODE
If you do not specify uioption, the default (first entry) will be used. | string?, Optional |
dateFrom | Date range start. Some reports do not require date ranges. Get the list of all reports and look for the needDateSelector boolean. If it is true you MUST specify a date range. | DateTime?, Optional |
dateTo | Date range end. | |
uilocale | To customize the language of the report. This is used for language names, country names and similar. Wordbee supports only a small subset of locales such as "en", "fr", "es", If you want to | DateTime?, Optional |
RESULTS
Immediate result
The operation may take more or less time depending on the amount of data in the report. Therefore it is implemented as an asynchronous operation.
The API method returns an Asynchronous operation result:
{
"trm": {
"requestid":32230,
"status":"Waiting",
"statusText":"Waiting..."
}
}
Poll for completion
If the operation is not completed (status = Finished), you need to poll every few seconds until completion with requestid. When finished you obtain a token to download the JSON file:
{
"trm": {
"requestid": 32230,
"isbatch": false,
"status": "Finished",
"statusText": "Finished!"
},
"custom": {
"filetoken": "1104cf62b1934e0f9ae40c43c4af1ae2",
"filename": "myreport.xlsx"
}
}
Download report file
Once you got the filetoken, you call media/get/{token} to download the report file.
Example:
GET /api/media/get/6dd25e68006e4f918c8dcd8f21d69255