EditTarget
Edit image - Upload target image
POST
Upload an image either by providing a local file or a URL.
Example:
import requestsimport jsonurl_api = 'https://api.piktid.com/api'# Option 1: Upload local filetarget_full_path = 'local_path_of_your_target_image'options = {}response = requests.post(url_api+'/edit/target',headers={'Authorization': 'Bearer '+TOKEN},files={'file': open(target_full_path, 'rb')},data={'options':json.dumps(options)},)# Option 2: Provide image URLimage_url = 'https://example.com/image.jpg'response = requests.post(url_api+'/edit/target',headers={'Authorization': 'Bearer '+TOKEN},data={'url': image_url,'options': json.dumps(options)},)response_json = json.loads(response.text)id_image = response_json.get('id_image')num_persons = response_json.get('num_persons')coordinates_list = response_json.get('coordinates_list')mask_links = response_json.get('mask_links')token_auth_2header
AuthorizationBearer <token>multipart/form-data- body
file?unknownurl?stringoptions?stringSuccess
application/json- response
id_image?stringnum_persons?integercoordinates_list?array<>mask_links?array<>curl -X POST "https://example.com/api/edit/target"{ "id_image": "string", "num_persons": 0, "coordinates_list": [ { "id": 0, "centerX": 0, "centerY": 0, "cornerX": 0, "cornerY": 0, "boxWidth": 0, "boxHeight": 0 } ], "mask_links": [ { "f": "string", "l": "string", "t": "string" } ]}