File Review API

Base URL: <https://app.nanonets.com>

Approve a File

Endpoint

POST /api/v2/ImageLevelInferences/Model/{model_id}/Verify/{request_file_id}

Description

This endpoint allows you to approve a file within a specified model. Approving a file updates its review status to approved, signifying that the data has been verified and is ready for further processing or export.

Request Parameters

  • model_id (string, required): The unique identifier of the model that the file belongs to.
  • request_file_id (string, required): The unique identifier of the file you want to approve. You can locate this ID on the extract data page associated with the model.

Sample Request:

curl:

curl -X POST "https://app.nanonets.com/api/v2/Inferences/Model/{model_id}/ImageLevelInferences/Verify/{request_file_id}" \
-H "Content-Type: application/json" \
-u "API_KEY:"

Python:

import requests

url = "https://app.nanonets.com/api/v2/Inferences/Model/{model_id}/ImageLevelInferences/Verify/{request_file_id}"

api_key = 'API_KEY'

response = requests.post(url, auth=(api_key, ''), headers={"Content-Type": "application/json"})

print(response.text)

Unapprove a File

Endpoint

POST /api/v2/ImageLevelInferences/Model/{model_id}/UnVerify/{request_file_id}

Description

This endpoint allows you to unapprove a file within a specified model. If a file has been approved, you can use this endpoint to change its status from approved to unapproved. Note that this endpoint cannot be used to reject a file; it is solely for unapproving a previously approved file.

Request Parameters

  • model_id (string, required): The unique identifier of the model that the file belongs to.
  • request_file_id (string, required): The unique identifier of the file you want to unapprove. This ID can also be found on the extract data page of the model.

Sample Request:

curl:

curl -X POST "https://app.nanonets.com/api/v2/Inferences/Model/{model_id}/ImageLevelInferences/UnVerify/{request_file_id}" \
-H "Content-Type: application/json" \
-u "API_KEY:"

Python:

import requests

url = "https://app.nanonets.com/api/v2/Inferences/Model/{model_id}/ImageLevelInferences/UnVerify/{request_file_id}"

api_key = 'API_KEY'

response = requests.post(url, auth=(api_key, ''), headers={"Content-Type": "application/json"})

print(response.text)

Points to note:

  • The "Approve a File" endpoint can only be used to approve a file that is either in the "validation passed" stage or in any stage configured within the approval stages, even if some rules have failed.
  • The "Approve a File" endpoint cannot be used to approve a file that has been rejected. Once a file is rejected, it becomes immutable, and its status cannot be changed.
  • The "Unapprove a File" endpoint can only be used to unapprove a file that was previously approved.