Examples

POST /api/report_templates
{
  "report_template": {
    "name": "report_template_test",
    "template": "a,b,c",
    "organization_ids": [
      114267492
    ]
  }
}
201
{
  "template": "a,b,c",
  "default": false,
  "snippet": false,
  "locked": false,
  "created_at": "2019-09-11 14:39:38 UTC",
  "updated_at": "2019-09-11 14:39:38 UTC",
  "name": "report_template_test",
  "id": 1007981732,
  "locations": [],
  "organizations": [
    {
      "id": 114267492,
      "name": "Empty Organization",
      "title": "Empty Organization",
      "description": null
    }
  ]
}

Params

Param Name Description
location_id
Optional

Abast per ubicacions

Validations:

  • Must be a Integer

organization_id
Optional

Abast per organitzacions

Validations:

  • Must be a Integer

report_template
Required

Validations:

  • Must be a Hash

report_template[name]
Required

Validations:

  • Must be a String

report_template[template]
Required

Validations:

  • Must be a String

report_template[snippet]
Optional , <span class="translation_missing" title="translation missing: ca.apipie.nil_allowed">Nil Allowed</span>

Validations:

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

report_template[audit_comment]
Optional , <span class="translation_missing" title="translation missing: ca.apipie.nil_allowed">Nil Allowed</span>

Validations:

  • Must be a String

report_template[locked]
Optional , <span class="translation_missing" title="translation missing: ca.apipie.nil_allowed">Nil Allowed</span>

Determina si una plantilla està bloquejada o no per a l’edició

Validations:

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

report_template[default]
Optional , <span class="translation_missing" title="translation missing: ca.apipie.nil_allowed">Nil Allowed</span>

Whether or not the template is added automatically to new organizations and locations

Validations:

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

report_template[location_ids]
Optional , <span class="translation_missing" title="translation missing: ca.apipie.nil_allowed">Nil Allowed</span>

SUBSTITUEIX les ubicacions amb els ID donats

Validations:

  • Must be an array of any type

report_template[organization_ids]
Optional , <span class="translation_missing" title="translation missing: ca.apipie.nil_allowed">Nil Allowed</span>

SUBSTITUEIX les organitzacions amb els ID donats.

Validations:

  • Must be an array of any type