Skip to content

Get Started

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.

HTTP
GET {{host}}/api/srs/{{srs_id}}
Authorization: Token {{token}}

Execute

This api will execute the SRS and return the result in the specified format.

HTTP
GET {{host}}/api/srs/{{srs_id}}/{{renderer}}
Authorization: Token {{token}}

Note

  • pscope optional query parameter - limits execution to comma-separated command names
  • ptoken optional 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 srssetup will 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
1
2
3
4
5
6
7
8
POST {{host}}/api/srs/{{srs_id}}/{{renderer}}
Authorization: Token {{token}}
Content-Type: application/json

{
    "param1": "value1",
    "param2": "value2"
}

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 object
  • [name].lower.json - json object , simplified object , with lower case property names
  • .html - all columns except ex="false", empty command, command with types hidden,server are not exported
  • .xlsx - only columns with ex="false" ,empty datasets and type hidden,server are not exported
  • .txt - RAW data
  • .md - RAW data with formatted tables

Handlebars templates

This Format use Handlebars templatess 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

Pixel Perfect PDf/HTML

This Format use Fast Report templates. Template is required in /template as file {renderer}.frx

  • .frx.html - HTML required frx tempalte in /template directory
  • .frx.pdf - PDF required frx tempalte in /template directory
  • .frx - report template with data (srs_Administrator)