How do I use the API to mark files as verified?

You can use the following script to mark files as verified using the API:

import requests, 

jsonmodel_id = "MODEL_ID"
api_key = "API_KEY file_id = "FILE_ID" url = 'https://app.nanonets.com/api/v2/Inferences/Model/' + model_id + '/ImageLevelInferences?start_day_interval=18000&current_batch_day=19000'
print(url) response = requests.request('GET', url, auth=requests.auth.HTTPBasicAuth('api_key','')) all_data = response.json()
file_data = '' for i in all_data['unmoderated_images']:
if i['id'] == file_id:
file_data = i
file_data['is_moderated'] = True
url = "https://app.nanonets.com/api/v2/Inferences/Model/" + model_id + "/ImageLevelInference" response = requests.patch(url, auth=requests.auth.HTTPBasicAuth(api_key, ''), json=file_data)
print(response.status_code)
print(response.text)



Was this article helpful?