Feedback API: Patching attributes, Classification, Extraction-validation

Learn how to use the API for sending feedback on data and attributes

What to use it for

The Feedback API can be considered if you want to change document or field information in your system and not on the Parashift Platform.

The following information can be adjusted using the Feedback API:

  1. Document re-classification
  2. Change some document attributes
  3. Change field values in the Extraction Validation

The information can be adjusted while the document is still being processed or when the document processing is complete. The information that is sent to the Platform will also be included in the training data.

General Requirements

Before considering the Feedback API the customer needs to clarify if there are available integration resources that can be used to integrate the feedback API. In addition you need the ability to adjust the end system where the changes should happen.

Classification:

Requirements Classification

The reclassification of documents can be done relatively quickly. The only information that is needed is the correct document type. The customer needs to create an option in the end system for the user to choose the correct document type. If the user changes a document type, the integration must send the information using the proper document type to the Parashift Platform over the Feedback API. The document information then needs to be pulled again over the API since there is new information.

How to set it up

The following information can be changed:

  • document_type_identifier: change document type identifier

To change the document type the following request needs to be used and the information above needs to be adjusted in the body. The API call can be found in our API Documentation: Change Classification

Request:

Edit or replace the information as needed or leave as is

POST https://api.parashift.io/v2/documents//classify

Sample payload:

{

    "data": {

        "type": "documents",

        "attributes": {

            "document_type_identifier": "pp-correspondence"

        }

    }

}

Document Attributes:

Requirements Document Attribute

The changing of document attributes requires an option in the end system where the user can change and define the new information that needs to be sent to the platform. This information then needs to be automatically sent to the Parashift Platform via Feedback API.

How to set it up

The user can update or edit different attributes. The following attributes can be adjusted:

  • name: new name or leave as is
  • custom_fields: change information between the "" or leave as is
  • external_id: new external id or leave as is
  • not_for_training: change to false or leave as is
To change the document attributes the following request needs to be used and the information above needs to be adjusted in the body. The API call can be found in our API Documentation:

Patch Attibutes

Request:

Replace the with the corresponding document ID

PATCH https://api.parashift.io/v2/documents/

Sample payload:

Edit or replace the information or leave as is

{
    "data": {
        "id": "",
        "type": "documents",
        "attributes": {
            "custom_fields": {
                "SomeCustomField": "These custom fields cannot be queried.",
                "AnotherCustomField": "If you want to query for an external ID please use external_id.",
                "YetAnotherCustomField": "external_id can be queried and used for lookups to get your data back."
            },
            "external_id": "EX123456789",
            "name": "A cool name of course",
            "not_for_training": true
        }
    }
}

Extraction-Validation:

Requirements Extraction Validation

Changing field or fieldset information requires the user to select the correct coordinates for the token that needs to be corrected. This requires an option in the end system to add the coordinates and value of the correct information. This needs to be accurate since the information is added to the training. The integration must then send the new value in the correct format to the proper field.

How to set it up

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:

  • id: add corresponding document id
  • 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”)

To change the field or fieldset information, the following request needs to be used, and the information above needs to be adjusted in the body.

Request:

Replace the with the corresponding document ID

PATCH https:/api.parashift.io/documents/

Sample payload:

    "data": { 

        "id": , 

        "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

                    }

                }

            }

    ]

Recommended Readings

To better understand the workflows of the Parashift Platform, the following readings and videos are recommended:

API Documentation: docs.parashift.io

Basic Integration: How to integrate the Parashift Platform

Need Help

If you encounter any issues or need further guidance, feel free to contact us at support@parashift.io. Our support team is available as part of your support package