GET /api/report_templates 200 { "total": 1, "subtotal": 1, "page": 1, "per_page": 20, "search": "report_template23", "sort": { "by": null, "order": null }, "results": [ { "created_at": "2018-11-15 19:01:55 UTC", "updated_at": "2018-11-15 19:01:55 UTC", "name": "report_template23", "id": 1007981803 } ] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
search optional |
filter results Validations:
|
order optional |
Sort field and order, eg. ‘id DESC’ Validations:
|
page optional |
paginate results Validations:
|
per_page optional |
number of entries per request Validations:
|
Field name | Type | Possible values |
---|---|---|
default | true, false | |
location | string | |
location_id | integer | |
locked | true, false | |
name | string | |
organization | string | |
organization_id | integer | |
snippet | true, false | |
template | text |
GET /api/report_templates/1007981803-report_template16 200 { "template": "template content 15", "default": false, "created_at": "2018-11-15 19:01:55 UTC", "updated_at": "2018-11-15 19:01:55 UTC", "name": "report_template16", "id": 1007981803, "locations": [], "organizations": [] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
POST /api/report_templates { "report_template": { "name": "report_template_test", "template": "a,b,c", "organization_ids": [ 114267492 ] } } 201 { "template": "a,b,c", "default": false, "created_at": "2018-11-15 19:01:54 UTC", "updated_at": "2018-11-15 19:01:54 UTC", "name": "report_template_test", "id": 1007981804, "locations": [], "organizations": [ { "id": 114267492, "name": "Empty Organization", "title": "Empty Organization", "description": null } ] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
report_template required |
Validations:
|
report_template[name] required |
Validations:
|
report_template[template] required |
Validations:
|
report_template[snippet] optional , nil allowed |
Validations:
|
report_template[audit_comment] optional , nil allowed |
Validations:
|
report_template[locked] optional , nil allowed |
Whether or not the template is locked for editing Validations:
|
report_template[default] optional , nil allowed |
Whether or not the template is added automatically to new organizations and locations Validations:
|
report_template[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
report_template[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
POST /api/report_templates/import { "report_template": { "name": "report_template32", "template": "b" } } 201 { "template": "b", "name": "report_template32", "id": 1007981804, "snippet": false, "template_kind_id": null, "created_at": "2018-11-15T19:01:55.401Z", "updated_at": "2018-11-15T19:01:55.410Z", "locked": false, "default": false, "vendor": null, "os_family": null }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
report_template required |
Validations:
|
report_template[name] optional |
template name Validations:
|
report_template[template] optional |
template contents including metadata Validations:
|
report_template[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
report_template[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
options optional |
Validations:
|
options[force] optional , nil allowed |
use if you want update locked templates Validations:
|
options[associate] optional , nil allowed |
determines when the template should associate objects based on metadata, new means only when new template is being created, always means both for new and existing template which is only being updated, never ignores metadata Validations:
|
options[lock] optional , nil allowed |
lock imported templates (false by default) Validations:
|
options[default] optional , nil allowed |
makes the template default meaning it will be automatically associated with newly created organizations and locations (false by default) Validations:
|
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
version optional |
template version Validations:
|
PUT /api/report_templates/1007981804-report_template2 { "report_template": { "audit_comment": "aha", "template": "tmp" } } 200 { "template": "tmp", "default": false, "created_at": "2018-11-15 19:01:54 UTC", "updated_at": "2018-11-15 19:01:54 UTC", "name": "report_template2", "id": 1007981804, "locations": [], "organizations": [] }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
report_template required |
Validations:
|
report_template[name] optional |
Validations:
|
report_template[template] optional |
Validations:
|
report_template[snippet] optional , nil allowed |
Validations:
|
report_template[audit_comment] optional , nil allowed |
Validations:
|
report_template[locked] optional , nil allowed |
Whether or not the template is locked for editing Validations:
|
report_template[default] optional , nil allowed |
Whether or not the template is added automatically to new organizations and locations Validations:
|
report_template[location_ids] optional , nil allowed |
REPLACE locations with given ids Validations:
|
report_template[organization_ids] optional , nil allowed |
REPLACE organizations with given ids. Validations:
|
DELETE /api/report_templates/1007981803-report_template20 { "report_template": {} } 200 { "id": 1007981803, "name": "report_template20", "template": "template content 19", "snippet": false, "template_kind_id": null, "created_at": "2018-11-15T19:01:55.228Z", "updated_at": "2018-11-15T19:01:55.228Z", "locked": false, "default": false, "vendor": null, "os_family": null }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
POST /api/report_templates/1007981804-report_template12/clone { "report_template": { "name": "MyClone" } } 201 { "id": 1007981805, "name": "MyClone", "template": "template content 12", "snippet": false, "template_kind_id": null, "created_at": "2018-11-15T19:01:55.063Z", "updated_at": "2018-11-15T19:01:55.063Z", "locked": false, "default": false, "vendor": null, "os_family": null }
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
report_template required |
Validations:
|
report_template[name] required |
template name Validations:
|
GET /api/report_templates/1007981804-report_template4/export 200 template content 4 <%# name: report_template4 snippet: false model: ReportTemplate %>
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
POST /api/report_templates/1007981804/generate { "input_values": { "hello": "ohai" }, "report_template": {} } 200 2 ohai
Param name | Description |
---|---|
location_id optional |
Scope by locations Validations:
|
organization_id optional |
Scope by organizations Validations:
|
id required |
Validations:
|
input_values optional |
Hash of input values where key is the name of input, value is the value for this input Validations:
|