Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2273,7 +2273,10 @@ paths:
get:
tags: [Beneficiary Categories]
summary: List Custom Field definitions (Contact Bio Forms)
description: Filter by `beneficiary_category_ids[]` to get fields for specific forms.
description: |
Filter by `beneficiary_category_ids[]` to get fields for specific forms. Each field's
`capture_type` is `video`, `audio` or `picture` for a Video, Audio or Picture question (an
Attachment field, `field_data_type: file`, that asks for that kind of media), otherwise null.
operationId: listCustomFields
security: [{tokenAuth: []}]
parameters:
Expand Down Expand Up @@ -6738,7 +6741,8 @@ paths:
`activity_trackers` and `metrics`.
- **toolkit**: `description` and `contents`, each with `type`, `id` and `name`.
- **activity_tracker**: `description`, `instruction`. **outcome**: `description`, `metrics`.
**unit**: `alignment`. **field**: `field_type`. **project_type**: `strapline`,
**unit**: `alignment`. **field**: `field_type`, and `capture_type` (`video`, `audio` or
`picture`) for a Video, Audio or Picture question. **project_type**: `strapline`,
`description`. **idea**: `description`.

Linked Outcomes and Metrics are named only when you may see them. An item you may not see
Expand Down Expand Up @@ -7005,6 +7009,13 @@ paths:
Field is a heading with `section_text` under it; it isn't listed in the library, so the
response has only its `id`, `type`, `name` and `approved`. Fields are never shared in the
public library. Near-identical names get `409`, as for **Create a List**.

**Video, Audio and Picture questions.** `video`, `audio` and `picture` create a Video, Audio
or Picture question for a Survey (Story Category): an Attachment Field that asks for that kind
of media, which the person answering can record or take there and then with their camera or
microphone, or attach from their device. It is stored and returned as `field_type: file` with
`capture_type` set to `video`, `audio` or `picture`, and its answers are uploaded files like any
other Attachment answer.
security: [{tokenAuth: []}]
requestBody:
required: true
Expand All @@ -7021,7 +7032,10 @@ paths:
type: string
field_data_type:
type: string
enum: [text, number, date, time, file, section_title, email_address, telephone, signature]
enum: [text, number, date, time, file, video, audio, picture, section_title, email_address, telephone, signature]
description: |
The kind of answer. `file` is an Attachment for any file; `video`, `audio` and
`picture` ask for that kind of media (see above).
section_text:
type: string
description: For a section_title Field only
Expand All @@ -7030,10 +7044,19 @@ paths:
description: True if only the organisation's staff may see the answers
force:
$ref: '#/components/schemas/ForceCreate'
example:
organisation_id: 913
field_name: "Postcode"
field_data_type: text
examples:
text:
summary: A text Field
value:
organisation_id: 913
field_name: "Postcode"
field_data_type: text
video:
summary: A Video question
value:
organisation_id: 913
field_name: "Record a short video telling us what you learnt today"
field_data_type: video
responses:
"201":
$ref: '#/components/responses/LibraryItemCreated'
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2221,7 +2221,7 @@ function buildDocsPage() {
${endpointCard("POST", "/fields", "Create a Field", true, [
{ name: "organisation_id", in: "body", type: "integer", required: true, desc: "The organisation (Charity) that will own it; you must be one of its editors" },
{ name: "field_name", in: "body", type: "string", required: true, desc: "The question, e.g. <code>Date of birth</code>" },
{ name: "field_data_type", in: "body", type: "string", required: true, desc: "<code>text</code>, <code>number</code>, <code>date</code>, <code>time</code>, <code>file</code>, <code>section_title</code>, <code>email_address</code> or <code>telephone</code>" },
{ name: "field_data_type", in: "body", type: "string", required: true, desc: "<code>text</code>, <code>number</code>, <code>date</code>, <code>time</code>, <code>file</code>, <code>video</code>, <code>audio</code>, <code>picture</code>, <code>section_title</code>, <code>email_address</code>, <code>telephone</code> or <code>signature</code>. <code>video</code>, <code>audio</code> and <code>picture</code> make a Video, Audio or Picture question: an Attachment that asks for that kind of media, which people can record or take in the survey. It is returned with <code>field_type: file</code> and <code>capture_type</code>" },
{ name: "section_text", in: "body", type: "string", required: false, desc: "For a <code>section_title</code> Field only" },
{ name: "private", in: "body", type: "boolean", required: false, desc: "Only the organisation's staff may see the answers" },
{ name: "force", in: "body", type: "boolean", required: false, desc: "<code>true</code> to create it even though a near-identical one exists (see 409)" }
Expand Down
Loading