Getting Rejected Documents over the API
When using Rossum's rejection workflow as a developer, you might be looking for how to:
- Get rejected documents over the API.
- Disable the rejection state over the API.
- Customize the rejection email template.
- Reject documents automatically.
- Get notifications about rejected documents.
Below, you can read about how to perform such operations over the API.
Getting rejected documents over the API
To get all documents in the rejected tab, you should list all the annotations on a specific queue in "rejected" status. Moreover, if you want to get the rejection notes' content, you should sideload the relevant notes. See the Postman request example below.
As you can see in the image above, the response returns a list of annotations and a list of related notes for each annotation. In this case, you are looking at the "rejection" type of notes.
Disabling the rejected state over the API
To enable/disable the rejected state over the API, you should look at the settings of a specific queue, which contains attribute rejection_config.
You can enable or disable the status in the rejection config. Moreover, you can customize the subject or content of the email to be sent when rejecting the document.
Rejecting documents automatically
Suppose you would like to reject the documents automatically. In that case, you can use the reject endpoint to switch a document to the "rejected" status.
The usual workflow is to get initially captured data, and based on the captured values, you can reject the document automatically.
Getting notifications about rejected documents
To get real-time notifications about rejected documents, you should implement a webhook or custom function listening to annotation_status.changed event action. You could then filter only the events where the annotation status event data has status rejected.
Updated about 2 years ago