Add images to a benchmark
Add images already in your workspace to a custom benchmark.
/v1/benchmarks/{benchmark_id}/imagesAdds up to 500 existing images to a custom benchmark. Every image must be in your default workspace, visible, and of the benchmark's scope; one image that is not refuses the whole request.
Images already in the benchmark are reported in
already_member_image_ids rather than added again, so a retry is
safe.
Authorization
bearerAuth Short-lived access token issued by Create a token.
Send it on every request as Authorization: Bearer <token>.
In: header
Path Parameters
The id of a custom benchmark in your default workspace.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Images already in your default workspace, such as an image_id from
Submit an image for scoring. Duplicates are
dropped.
1 <= items <= 500Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://ext.vizit.com/v1/benchmarks/497f6eca-6276-4993-bfeb-53cbbbba6f08/images" \ -H "Content-Type: application/json" \ -d '{ "image_ids": [ "7d59d86b-0fab-46dc-a3e1-ec52ebe432a5" ] }'{ "benchmark": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "Spring refresh hero set", "description": "string", "scope": "hero", "asset_type": "string", "image_count": 0, "minimum_images": 30, "recommended_images": 80, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "last_scoring": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "benchmark_id": "f1254acf-0c77-40a6-91d2-a34bd4970fd9", "retailer": "amazon", "product_category_id": "8df7b127-d8ab-4b5d-a571-ee2b3ab38511", "product_category_name": "Snack Bars", "status": "PROCESSING", "requested_at": "2019-08-24T14:15:22Z", "ready_at": "2019-08-24T14:15:22Z", "error_code": "ENQUEUE_FAILED" } }, "added_image_ids": [ "41eebb04-3fa2-419c-85c3-d25b347be0c3" ], "already_member_image_ids": [ "89a619ee-21a2-43ef-acb1-74168a9648c9" ]}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}{ "detail": "string", "status_code": 0, "error_code": "IMAGE_DOWNLOAD_FAILED", "request_id": "266ea41d-adf5-480b-af50-15b940c2b846", "extra": { "failed_urls": [ { "url": "https://cdn.example.com/broken.jpg", "reason": "IMAGE_DOWNLOAD_TIMEOUT" }, { "url": "https://cdn.example.com/icon.svg", "reason": "UNSUPPORTED_IMAGE_FORMAT" } ] }, "timestamp": "2019-08-24T14:15:22Z"}GETList a benchmark's images
Lists the visible images in a custom benchmark, sorted by `sort_by` and `sort_direction` with ties broken by image id. Page with `limit` and `offset`; the `Vizit-Total-Count` response header carries the number of images. Send `product_category_id` to have each row carry `pair_score`: the image's score against this benchmark under that category, from the benchmark's latest scoring under it ([Score a benchmark's images](/api/benchmarks/requestBenchmarkScoring)). Without it `pair_score` is `null`, and `sort_by=pair_score` answers `422 SORT_REQUIRES_PAIR`. Unscored images sort last in both directions; informational images have `vizit_score: null` and `scored: false` and sort with them. `classification` is `null` for an Other asset.
POSTUpload an image to a benchmark
Downloads one image from `image_url`, stores it in your default workspace with the benchmark's scope as its image type, and adds it to the benchmark. The image is downloaded with the same checks as [Submit an image for scoring](/api/images/scoreImage): a public HTTP or HTTPS URL to a JPEG, PNG or WebP image of up to 25 MB. Send `product_category_id` to score the image under that category as it lands. The response is `202` with `status: PROCESSING`, since scoring runs after the upload.