Template
Create template#
Creates a new template. Requires the
ROLE_SURVEY_ADMIN role.Request body:
| Attribute | Type | Description | Nullable |
|---|---|---|---|
| name | String | Template name | false |
| type | Enum of string | Template type: FORM, PHOTO_REPORT, SURVEY, APPLICATION | true |
| quick | Boolean | Whether this is a template for quick surveys | true |
| categoryId | String | Identifier of the template category | false |
| gradeConditions | List objects | Result grade thresholds (only for surveys with grades). See the gradeConditions field on the Template object | true |
| showGrades | Boolean | Whether to show grades when taking a survey. Default false | true |
| withGrades | Boolean | Whether the template uses grades. Default false | true |
| deleted | Boolean | Whether the template is deleted. Default false | true |
| hidden | Boolean | Whether the template is hidden from users. Default false | true |
Response
Returns the created Template object
Examples
200 OK
Update template#
Updates a template's settings, or deactivates it by passing
deleted: true. The template id is part of the request body, not the URL. Requires the ROLE_SURVEY_ADMIN role.Request body:
| Attribute | Type | Description | Nullable |
|---|---|---|---|
| id | String | Identifier of the template to update | false |
| name | String | Template name | false |
| quick | Boolean | Whether this is a template for quick surveys | true |
| categoryId | String | Identifier of the template category | false |
| gradeConditions | List objects | Result grade thresholds (only for surveys with grades). See the gradeConditions field on the Template object | true |
| showGrades | Boolean | Whether to show grades when taking a survey | true |
| withGrades | Boolean | Whether the template uses grades | true |
| deleted | Boolean | Whether the template is deleted | true |
| hidden | Boolean | Whether the template is hidden from users | true |
Response
Returns the updated Template object
Examples
200 OK
List templates#
Returns a list of Template objects matching the given filter.
Request parameters:
| Request Parameter | Type | Description | Required |
|---|---|---|---|
| page | Integer | Page number (0-based) | false |
| size | Integer | Number of elements per page | false |
Request body:
| Attribute | Type | Description | Nullable |
|---|---|---|---|
| ids | List of strings | Find templates by ids | true |
| categoryId | String | Find templates by category id | true |
| type | Set of string | Find templates by type: FORM, PHOTO_REPORT, SURVEY, APPLICATION | true |
| onlyActive | Boolean | Only return non-deleted templates. Default true | true |
| withHidden | Boolean | Include hidden templates | true |
| withQuestionsOnly | Boolean | Only return templates that have at least one question | true |
| quick | Boolean | Find templates by "quick" flag | true |
| updateAfter | LocalDateTime | Only return templates modified after this date and time | true |
| search | String | Find templates by name | true |
Examples
200 OK
Get short templates list#
Same filter as List templates, but returns a shorter object per template (just the fields needed to display a picker), which is cheaper for large tenants.
Request parameters:
| Request Parameter | Type | Description | Required |
|---|---|---|---|
| page | Integer | Page number (0-based) | false |
| size | Integer | Number of elements per page | false |
Request body:
| Attribute | Type | Description | Nullable |
|---|---|---|---|
| (body) | Object | Same filter fields as List templates | true |
Examples
200 OK
Get template by id#
Move to category#
Moves a template from one category to another.
Request parameters:
| Request Parameter | Type | Description | Required |
|---|---|---|---|
| fromCategory | String | Identifier of the template's current category | true |
| toCategory | String | Identifier of the destination category | true |
Response
Returns the moved Template object
Examples
200 OK
Copy template#
Creates a copy of an existing template, including its questions. Requires the
ROLE_SURVEY_ADMIN role.Request parameters:
| Request Parameter | Type | Description | Required |
|---|---|---|---|
| name | String | Name for the copy. Defaults to the original template's name if omitted | false |
| categoryId | String | Category for the copy. Defaults to the original template's category if omitted | false |
Response
Returns the newly created Template object
Examples
200 OK
Reorder template questions#
Sets the display order of the template's questions.
Request body:
| Attribute | Type | Description | Nullable |
|---|---|---|---|
| (body) | List of strings | Question ids, in the order they should appear | false |
Examples
200 OK