示例

POST /api/report_templates
{
  "report_template": {
    "name": "report_template_test",
    "template": ""
  }
}
422
{
  "error": {
    "id": null,
    "errors": {
      "template": [
        "can't be blank"
      ]
    },
    "full_messages": [
      "Template can't be blank"
    ]
  }
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

report_template
必填

Validations:

  • Must be a Hash

report_template[name]
必填

Validations:

  • Must be a String

report_template[description]
选填 , 允许空值

Validations:

  • Must be a String

report_template[template]
必填

Validations:

  • Must be a String

report_template[snippet]
选填 , 允许空值

Validations:

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

report_template[audit_comment]
选填 , 允许空值

Validations:

  • Must be a String

report_template[locked]
选填 , 允许空值

是否已锁定该模板进行编辑

Validations:

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

report_template[default]
选填 , 允许空值

模板是否会自动添加到新的机构和位置

Validations:

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

report_template[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

report_template[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type