Task form values
Correct the values of a form that has already been submitted from the mobile app.
This operation corrects a form that was already filled. It exists for fixing data submitted by mistake, not for filling an empty form: values can only be updated when the form was previously submitted from the Mobile Tracker App, for Android or iOS.
When it can be called depends on the task's state. Any caller can update values while the task is unassigned, assigned, or arrived, and the device must not be deleted. A sub-user holding the completed_form_update right can also update values once the task is done, failed, or delayed.
API actions
API base path: /task/form/values.
The values object maps each form field ID, as a string, to a value object:
{
"1223344": {
"type": "text",
"value": "text field value"
}
}For value object description, see Form fields and values.
Required sub-user rights: task_update.
{
"success": false,
"status": {
"code": 242,
"description": "There were errors during content validation"
},
"errors": [
{
"field_id": "111-aaa-whatever",
"code": 5,
"error": "text length constraints are not met"
}
]
}Validation error codes:
1 - field required but has no value.
2 - field value type doesn't match field type.
3 - field value is null.
4 - value index out of bounds.
5 - invalid value size.
6 - value less than minimum.
7 - value more than maximum.
8 - field contains invalid references.
9 - invalid file type.
10 - invalid file state.
Correct the values of a form already attached to a task.
This is for correcting a submitted form, not for filling an empty one. The form must have been submitted at least once from the Mobile Tracker App, and the task's device must not be deleted.
Allowed while the task is unassigned, assigned or arrived. A sub-user with the completed_form_update right may also act on a done, failed or delayed task. Anything else returns error 255.
When a value fails validation the call returns error 242 and an errors array whose entries carry field_id, a numeric code, and a message. The codes are listed on this page.
Requires the task_update right.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
ID of the task.
Form values updated
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error 101: the current user has the demo flag, and this operation is disabled in demo mode.
Error response object
POST /v2/task/form/values/update HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 61
{
"task_id": 1,
"values": {
"ANY_ADDITIONAL_PROPERTY": "anything"
}
}{
"success": true
}Errors
These errors come in addition to the general error codes:
101 - In demo mode this function disabled - if current user has "demo" flag.
201 - Not found in the database - if task with the specified ID does not exist.
255 - Invalid task state - if current task state is not
unassigned,assignedorarrived(plusdone,failed, anddelayedfor users withcompleted_form_updateright).242 - There were errors during content validation - if given values are invalid for the form. Example:
Last updated
Was this helpful?