GET /api/form_templates
List Form Templates

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  https://api.record360.com/api/form_templates

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate

{
  "form_templates": [
    {
      "id": "42",
      "url": "https://record360-media.s3.amazonaws.com/form_templates/42/form.pdf",
      "fields": {
        "Name": { "type": "string", "maxLength": 50 },
        "Street Address": { "type": "string", "maxLength": 100 },
        ...
      },
      "created_at": "2018-04-24T22:31:30.902Z",
      "updated_at": "2018-04-24T22:31:30.902Z"
    }, {
      "id": "43",
      "url": "https://record360-media.s3.amazonaws.com/form_templates/43/form.pdf",
      "fields": {
        "Name": { "type": "string", "maxLength": 50 },
        "Street Address": { "type": "string", "maxLength": 100 },
        ...
      },
      "created_at": "2018-04-24T23:31:00.0Z",
      "updated_at": "2018-04-24T23:31:00.0Z"
    },
  ],      
  "links": {
    "prev": "https://api.record360.com/api/form_templates?before_id=42&limit=2",
    "next": "https://api.record360.com/api/form_templates?after_id=43&limit=2"
  }
}

Params

Param name Description
before_id
optional

Return Form Templates before the specified ID

Validations:

  • Must be a String

after_id
optional

Return Form Templates after the specified ID

Validations:

  • Must be a String

limit
optional

Limit the number of Form Templates to return (max: 50)

Validations:

  • Must be a number.


GET /api/form_templates/:id
Show a particular FormTemplate (as JSON or PDF)

FormTemplate will be returned as JSON or PDF, depending on the Accept header or path extension (i.e. .json or .pdf)

Supported Formats

json, pdf

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  https://api.record360.com/api/form_template/42

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate

{
  "form_template": {
    "id": "42",
    "url": "https://record360-media.s3.amazonaws.com/form_templates/42/form.pdf",
    "fields": {
      "Name": { "type": "string", "maxLength": 50 },
      "Street Address": { "type": "string", "maxLength": 100 },
      ...
    },
    "created_at": "2018-04-24T22:31:30.902Z",
    "updated_at": "2018-04-24T22:31:30.902Z"
  }
}
$ curl -i \
  -H "Accept: application/pdf; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  https://api.record360.com/api/form_template/42

HTTP/1.1 302 Moved Temporarily
Content-Type: application/pdf; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate
Last-Modified: Thu, 26 Apr 2018 22:31:30 GMT
Location: https://record360-media.s3.amazonaws.com/form_templates/42/form.pdf

Params

Param name Description
id
required

FormTemplate ID

Validations:

  • Must be a String