Patch a Survey Item
When a user is taking a survey, they will be answering questions. This endpoint will be used to notify the API of those changes, one survey item at a time
Request
PATCH /accounts/{account-uuid}/surveys/{survey-uuid}/items/{item-uuid}
account-uuid
is a 22-character identifier for the accountsurvey-uuid
is a 22-character identifier for the surveyitem-uuid
is a 22-character identifier for the survey item
Authorization
Authorization
header is required for this endpoint. See Authorization Tokens for details about auth tokens.
Headers
N/A
Query Parameters
N/A
Body
The body of the request is expected to be an array of JSON Patch operations
Patching a survey item of type Select
will only allow you to change the value attribute like so:
[
{ "op": "replace", "path": "/value", "value": "selected-value-key" }
]
To clear, an answer for a Select
item type:
[
{ "op": "remove", "path": "/value" }
]
If patching a survey item of type Grid-Select
you will then reference the index of the sub-item like so:
[
{ "op": "replace", "path": "/subItems/{sub-item-key}/value", "value": "selected-value-key" }
]
To clear a Grid-Select
sub-item answer:
[
{ "op": "remove", "path": "/subItems/{sub-item-key}/value" }
]
Clearing
Warning
Patch operation must be within an array, even if you are sending just one operation
Response
Response | Status Code | More Information |
---|---|---|
Success | 200 |
If the patch operation was successful |
Not Found | 404 |
Survey or item does not exist with the provided UUID |
Bad Request | '400` | patch cannot be applied |
Unauthorized | 401 |
If user is not authorized for the requested survey |
Internal Server Error | 500 |
Unknown error |
Headers
N/A
Body
N/A