How to Use the API
To use the SRS API, you need to have a valid token. See authentication and execute the following GET/POST requests.
Definition
This api will return definition of SRS.
Execute
This api will execute the SRS and return the result in the specified format.
Note
pscopeoptional query parameter - limits execution to comma-separated command namesptokenoptional query parameter - authorizes request with token. See authentication- Error in any command will return Http Status 200 with status = false and message = error message
- Error in command with name
srssetupwill throw error message and the SRS will stop executing (This can be used to execute business logic before executing the SRS)
Parameters
When executing request, the parameters can be passed via query string, JSON body, or both.
Note
- If a name is duplicated in the query string and JSON body, the query string will take precedence.
| HTTP | |
|---|---|
Renderers
The renderer is the format in which the SRS will be executed. The following renderers are supported:
Basic types
api- optimized JSON format (array of tables) for internal use[name].json- JSON object, simplified format[name].lower.json- JSON object, simplified format with lowercase property names.html- all columns except those withex="false"; empty commands and commands with typeshiddenorserverare not exported.xlsx- only columns withex="false"; empty datasets and typeshiddenorserverare not exported.txt- raw data.md- raw data with formatted tables
Handlebars templates
This format uses Handlebars templates.
A template is required in /template as file {renderer}.hbs.
.hbs.html- html.hbs.pdf- pdf.hbs.csv- csv.hbs.txt- txt.hbs.xml- xml.hbs.epp- epp.hbs.svg- svg
Extra parameters
file_name
Default encoding for all files is UTF-8.
Encoding can be overridden by adding encoding after a comma in the query string.
Example ANSI encoding: /api/srs/123/test.hbs.txt?file_name=test.txt,ansi
Custom file name /api/srs/123/test.hbs.txt?file_name=test.txt
Pixel-Perfect PDF/HTML
This format uses Fast Report templates.
A template is required in /template as file {renderer}.frx.
.frx.html- HTML; requires an.frxtemplate in the/templatedirectory.frx.pdf- PDF; requires an.frxtemplate in the/templatedirectory.frx- report template with data (srs_Administrator)