Update Question
/form_templates/{template_id}/questions/{id}
Update Question [PUT]
Update an existing question. Any errors will be returned in the body of a 422 response.
Authorization: Admin
Request
Body{ "id": 13434, "title": "Can the hazard be eliminated without the use of PPE?", "definition": "", "required": "false", "hasAnswerLogic": false, "type": { "name": "singleSelect", "displayName": "Single Select", "id": 1 }, "payload": { "default": null, "defaultSelectionId": null, "selectionListId": 4532, "selections": [{ "id": 7989, "abbr": null, "value": "Yes", "color": null, "score": 1, "priorityId": 0 }, { "id": 7990, "abbr": null, "value": "No", "color": null, "score": 2, "priorityId": 3 }, { "id": 7991, "abbr": null, "value": "Not Applicable", "color": null, "score": 3, "priorityId": -1 }], "answerLogic": [], "statusLogic": [] }, "questionFilesCount": 0, "cannedCommentsCount": 0, "resourcesCount": 0, "calculatedFromFormula": false, "ordinal": 204, "hasStatusLogic": false, "num": 6, "formTemplateId": 480, "silent": true, "questionTypes": [{ "name": "singleSelect", "displayName": "Single Select", "id": 1, "ordinal": 10, "iconType": "fa-list-ul" }, { "name": "multiSelect", "displayName": "Multi Select", "id": 2, "ordinal": 20, "iconType": "fa-list" }, { "name": "shortText", "displayName": "Short Text (<50 chars)", "id": 3, "ordinal": 30, "iconType": "fa-font" }, { "name": "paragraphText", "displayName": "Paragraph Text (<1,000 chars)", "id": 4, "ordinal": 40, "iconType": "fa-paragraph" }, { "name": "number", "displayName": "Number", "id": 5, "ordinal": 50, "iconType": "fa-hashtag" }, { "name": "date", "displayName": "Date", "id": 6, "ordinal": 60, "iconType": "fa-calendar-o" }, { "name": "time", "displayName": "Time", "id": 7, "ordinal": 70, "iconType": "fa-clock-o" }, { "name": "sketch", "displayName": "Sketch", "id": 8, "ordinal": 80, "iconType": "fa-paint-brush" }, { "name": "signature", "displayName": "Signature", "id": 9, "ordinal": 90, "iconType": "fa-terminal" }, { "name": "table", "displayName": "List / Table", "id": 10, "ordinal": 100, "iconType": "fa-th" }], "questionTypeId": "", "selectionListId": "4532", "questionHeadingId": 4984 }
Response 422
Body
{ "errors": { "title": ["Cannot have duplicate titles within the same heading."] } }
Response 200
Body
{ "item": { "id": 13434, "title": "Can the hazard be eliminated without the use of PPE?", "definition": null, "required": false, "hasAnswerLogic": false, "type": { "name": "singleSelect", "displayName": "Single Select", "id": 1 }, "payload": { "default": null, "defaultSelectionId": null, "selectionListId": 4532, "selections": [{ "id": 7989, "abbr": null, "value": "Yes", "color": null, "score": 1, "priorityId": 0 }, { "id": 7990, "abbr": null, "value": "No", "color": null, "score": 2, "priorityId": 3 }, { "id": 7991, "abbr": null, "value": "Not Applicable", "color": null, "score": 3, "priorityId": -1 }], "answerLogic": [], "statusLogic": [] }, "questionFilesCount": 0, "cannedCommentsCount": 0, "resourcesCount": 0, "questionHeading": { "id": 4984, "name": "Default" }, "calculatedFromFormula": false, "ordinal": 204, "hasStatusLogic": false } }