Score a collection
Score a collection's images against a benchmark under a product category.
/v1/collections/{collection_id}/scoringsScores the collection's visible images under product_category_id
against exactly one of a custom benchmark (benchmark_id, of the
same scope as the collection) or a retailer's Vizit benchmark
(retailer). A custom benchmark needs minimum_images visible
images. The response is 202 with a scoring id; poll it with
Retrieve a collection scoring.
Repeating the request for the same pair within 5 minutes returns the same scoring without queueing it 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 collection in your default workspace.
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Category to score under. Must be one returned by List product categories.
uuidA custom benchmark in your default workspace, of the same scope as
the collection's image_type.
uuidThe retailer whose Vizit benchmark to use.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://ext.vizit.com/v1/collections/497f6eca-6276-4993-bfeb-53cbbbba6f08/scorings" \ -H "Content-Type: application/json" \ -d '{ "product_category_id": "8df7b127-d8ab-4b5d-a571-ee2b3ab38511" }'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "benchmark_id": "f1254acf-0c77-40a6-91d2-a34bd4970fd9", "retailer": "amazon", "collection_id": "4bdef85c-3f50-4006-a713-2350da665f80", "product_category_id": "8df7b127-d8ab-4b5d-a571-ee2b3ab38511", "status": "PROCESSING", "requested_at": "2019-08-24T14:15:22Z", "total_images": 0, "enqueued_images": 0}{ "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"}POSTUpload images to a collection
Downloads up to 50 images and stores each in the collection, with the collection's image type and product category. Each image is a public HTTP or HTTPS URL to a JPEG, PNG or WebP image of up to 25 MB. New images are scored under the collection's existing scorings once their first scores land. Each image succeeds or fails on its own, so one bad URL never refuses the batch. The response is `202` with one result per requested image, in request order: `PROCESSING` with an `image_id` for a stored image, or `ERROR` with a `reason` for a failed one. Downloads share a time budget, so an image not yet uploading when it runs out fails with `IMAGE_DOWNLOAD_TIMEOUT` and is not stored. There is no deduplication by URL: retrying a whole batch stores the accepted images again. Retry only the failed items.
GETRetrieve a collection scoring
Returns the progress of a collection scoring. Poll until `status` leaves `PROCESSING`: it reaches `COMPLETED` once every image is scored or unreadable, and `ERROR` if it is still incomplete 30 minutes after the request, with `error_code` saying why. A scoring of another collection answers `404 COLLECTION_SCORING_NOT_FOUND`.