The reports are generated asynchronously. If mail_to is not given, action returns an url to get resulting report from (see report_data).

Examples

POST /api/report_templates/:id/schedule_report/
200
{
  "job_id": UNIQUE-REPORT-GENERATING-JOB-UUID
  "data_url": "/api/v2/report_templates/1/report_data/UNIQUE-REPORT-GENERATING-JOB-UUID"
}
POST /api/report_templates/1007981703/schedule_report
{
  "input_values": {
    "foo": "bar"
  },
  "report_template": {}
}
200
{
  "job_id": "JOB-UNIQUE-IDENTIFIER",
  "data_url": "/api/v2/report_templates/1007981703-report_template113/report_data/JOB-UNIQUE-IDENTIFIER"
}

Params

Param Name Description
location_id
Optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
Optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
Required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

input_values
Optional

Hash of input values where key is the name of input, value is the value for this input

Validations:

  • Must be a Hash

gzip
Optional

Compress the report using gzip

Validations:

  • Must be one of: true, false, 1, 0.

mail_to
Optional

If set, scheduled report will be delivered via e-mail. Use ‘,’ to separate multiple email addresses.

Validations:

  • Must be a String

generate_at
Optional

UTC time to generate report at

Validations:

  • Must be a String

report_format
Optional

Report format, defaults to ‘csv’

Validations:

  • Must be one of: csv, json, yaml, html.