Overview:
WinsurTech Document Reader API Endpoints
This endpoint generates the ‘access-token’ after the user login with their Winsurtech Document Reader credentials in the login endpoint. An access token is used to get access to other endpoints and it is valid for 30 minutes.
This endpoint reads the data of the flattened pdfs and images in the background and POSTS the JSON response to the CALLBACK URL that a user provides of their application.
In this endpoint, the user checks the status and fetches the output of the scanned document.
In this endpoint, the user gets the custom mapping keys.
In this endpoint, the user gets information about the keys that the user will get from the custom mapping key endpoint.
In this endpoint, the user updates the custom keys.
In this endpoint, the user generates a custom mapping template from a form.
In this endpoint, the user adds generated custom mapping template, and the custom mapping key gets added for that form.
In this endpoint, the user gets a list of forms currently being supported.
In this endpoint, the user add new forms to support it in the scan document endpoint.
WinsurTech Document Reader API Endpoints Detailed Information
Login
API URL: https://apis.docreader.winsurtech.com/v1/login
Method Type: POST
Description
This API endpoint is used to get an access token with the user's credentials of Winsurtech Document Reader. The access_token gets auto-filled when we login and it is valid for 30 minutes, access_token gives the user an authorization to use other endpoints as it gets passed in different APIs header. After the token gets expires the user can make another call to get a new access_token.
Input Parameters:
Key (Body Parameter) |
Value |
Is Mandatory |
Default Value |
Description |
username |
Text |
Yes |
null |
The email address of your account |
password |
Text |
Yes |
null |
The password of your account |
Postman Screenshot
Scan Document
API URL: https://apis.docreader.winsurtech.com/v1/scan
Method Type: POST
Description
Use this endpoint for read only forms that have lost their eLabels and also for images. This endpoint reads the data of the input_file in the background and POSTS the JSON response to the CALLBACK URL that a user provides of their application. Your application can receive the output JSON and store the extracted data in your database or other storage. Initially on calling /scan endpoint in the response you will get the status, transaction id, message, input file name, and file size. After the files are processed in a few seconds the output is posted to CALLBACK URL.
Input Parameters:
Key (Body Parameter) |
Value |
Is Mandatory |
Default Value |
Description |
input_file |
File |
Yes |
null |
Upload the file |
callback_url |
Text |
Yes |
null |
The callback url |
custom_mapping_key |
Text |
No |
null |
Enter your custom key |
omit_blank_values |
Text |
No |
true |
Enter true or false |
save_output_temporarily |
Text |
No |
true |
Enter true or false |
In input_file: Users can upload the .pdf, .jpg, .jpeg, and .zip files.
In custom_mapping_key: Enter your custom mapping key to return custom elabels in the output that you mapped before for the form.
In callback_url: Enter the URL where the users are looking forward to storing the response.
In omit_blank_values: Enter the value as true if you want to omit the blank values from the output else enter false. The default value is assumed to be true.
In save_output_temporarily: Enter the value as true, if you want the output file to be saved for 2 hours at WinsurTech, so that you could call the FETCH CALLBACK Output endpoint to fetch the output later on as well based on the transaction id, else enter false if you don't want to save the output and just want it posted once to your CALLBACK URL. The default value is assumed to be true.
Postman Screenshot
Sample Output
Fetch Callback Output
API URL: https://apis.docreader.winsurtech.com/v1/fetch-callback-output
Method Type: GET
Description
This endpoint is used to fetch the output of the scanned document based on the transaction id. The user can check the status of the /scan request. If the request is still queued, the JSON response will show queued or waiting, else if the request is in progress then the JSON response will show the output as under processing, and if the request is processed successfully then the endpoint returns the output status as successful and if the user wants to have the partial output then they can keep the value of get_partial_output as true and output is returned in compressed format.
Input Parameters:
Key (Body Parameter) |
Value |
Is Mandatory |
Default Value |
Description |
transaction_id |
Text |
Yes |
null |
Enter the transaction id |
get_partial_output |
Text |
No |
False |
Enter true or false |
In transaction_id: Enter the /scan call’s transaction_id.
In get_partial_output: If the user wants to get partial output then they should keep the value as true otherwise false. The default value is assumed to be false.
In case of true: If save_output_temporarily is entered as true, you will get output in Fetch Callback Output and can save the file.
In case of false: If save_output_temporarily is entered as false then in Fetch Callback Output you will get the status as “successful“ and a message in transaction status will display as “Output not saved on our platform, it is sent to callback URL”.
Postman Screenshot
Case 1:
Case 2:
In postman, save this response by clicking on Save Response → Save to a file.
The output will be in a compressed format, and users are required to save it to their disk with a filename having a .zip extension and later on decompress the file.
Get Custom Mapping Keys
API URL: https://apis.docreader.winsurtech.com/v1/get-custom-mapping-keys
Method Type: GET
Description
This endpoint is used to get custom mapping keys. Click on the send button and user will get custom mapping keys with their form name.
Postman Screenshot
Get Custom Mapping Detail
API URL: https://apis.docreader.winsurtech.com/v1/get-custom-mapping-detail
Method Type: GET
Description
This endpoint is used to get information about the keys that user will get in get custom mapping keys endpoint. User just needs to copy a key from the response of get custom mapping keys endpoint and paste it in parameters as value of custom_mapping_key and click on send. In response user will get all information about original or replaced keys and values for a particular document.
Postman Screenshot
Sample Output
Update Custom Mapping Detail
API URL: https://apis.docreader.winsurtech.com/v1/update-custom-mapping-detail
Method Type: PUT
Description
This endpoint is used when user need to update the custom mapping then he simply just copy the value of original key or value from the response of get custom mapping detail endpoint and paste it in original key or value of body parameter of update custom mapping details endpoint and in custom key or value, user can write the custom names that they want to change. If the user only wants to change custom keys then he can send an empty list in custom_values and vice versa in case of custom_keys. The user can send multiple original and custom values in a list as dictionaries separated by commas. The user just needs to copy a key from the response of get custom mapping keys endpoint and paste it in body as value of custom_mapping_key and click on send.
Input Parameters:
Postman Screenshot
Generate Custom Mapping Template
API URL: https://apis.docreader.winsurtech.com/v1/generate-custom-mapping-template
Method Type: POST
Description
This endpoint is used to generate a custom mapping template from a form. Users can upload a form in the body parameter and click on send.
Input Parameters:
Key (Body Parameter) |
Value |
Is Mandatory |
Default Value |
Description |
input_file |
File |
Yes |
null |
Upload the PDF file |
Postman Screenshot
Sample Output
Add Custom Mapping Detail
API URL: https://apis.docreader.winsurtech.com/v1/add-custom-mapping-detail
Method Type: POST
Description
This endpoint is used to create a custom mapping through a template that we get in response from generate custom mapping template endpoint. Users just need to copy the template from generate custom mapping template endpoint and paste it into the body parameter of add custom mapping detail endpoint. After pasting the template the user can add custom keys or values if they want to customize the elabels. Then click on send, and the custom mapping key will be added.
Input Parameters:
Postman Screenshot
Scan Supported Forms
API URL: https://apis.docreader.winsurtech.com/v1/scan-supported-forms
Method Type: GET
Description
This endpoint is used to get a list of forms currently being supported. Users just need to click on send.
Postman Screenshot
Sample Output
Add New Form
API URL: https://apis.docreader.winsurtech.com/v1/add-new-form
Method Type: POST
Description
This endpoint is used to add new forms to support it in the scan document endpoint. The user will upload the form pdf in the body parameter and then click on send, and the form will be added.
Key (Body Parameter) |
Value |
Is Mandatory |
Default Value |
Description |
input_file |
File |
Yes |
null |
Upload the PDF file |
Postman Screenshot