Learn how to use the API for sending feedback on data and attributes
Advanced Users can perform the following things using API calls:
- classify a document
- change some document attributes
- validate the fields in a document
Classification:
The user can send a POST request to a new endpoint "classify" as described in the API documentation (https://docs.parashift.io/#206cf429-b1d0-4aaf-8cbf-015867c3a5b8) to classify a document.
Request:
POST https://api.parashift.io/v2/documents/123456/classify
Sample payload:
{
"data": {
"type": "documents",
"attributes": {
"document_type_identifier": "pp-correspondence"
}
}
}
Document Attributes:
The user can update/edit different attributes like name, custom fields, validation_required, external id, training flag. etc of a document over the API by sending a PATCH request to the documents endpoint. (https://docs.parashift.io/#8e0851a7-127e-42f5-8192-ed4d07240a46)
Request:
PATCH https://api.parashift.io/v2/documents/123456
Sample payload:
{
"data": {
"id":123456,
"type": "documents",
"attributes": {
"not_for_training": false,
"validation_required": true,
"external_id": 111111,
"custom_fields": {
"another_custom_field": "another_custom_field"
}
}
}
}
Extraction-Validation:
The user can validate a document by patching different values to the corresponding document fields for a certain document. The payload needs to have the coordinates along with the values for each of the fields to be patched.
Request:
PATCH https:/api.parashift.io/documents/123456789
This request is similar to patching the document attributes, but one has to add all the fields to be validated in the list “included”. Different params to be included are as follows:
- identifier: identifier of the field
- fieldset_identifier: identifier of the fieldset – if there is none, please use “null” or remove this attribute
- item_index: the row index for a repeatable section (e.g. table). If the section is not repeatable (e.g. not part of a table), please use “null”
- confirm_warnings: Boolean (true or false), to get info on warnings
- external_value: the value to be entered for this field
- page_number: page_number, where this field could be found in the document
- coordinates: 4 float values (0 to 1) as the normalized page coordinates, defining the bounding box of the field (“top”, “bottom”, “left”, “right”)
Sample payload:
{
"data": {
"id": 123456789,
"type": "documents"
},
"included": [
{
"type": "document_fields",
"attributes": {
"identifier":"this-is-the-identifier-of-the-field",
"fieldset_identifier": null,
"item_index": null,
"confirm_warnings": true,
"external_value": "THIS IS THE NEW VALUE",
"page_number": 0,
"coordinates": {
"top": 0.235,
"left": 0.439,
"right": 0.500,
"bottom": 0.245
}
}
}
]
}