DELETE /imgs endpoint.
Deletion can be performed on a single image or on an entire batch (the recommended approach for removing large numbers of images). To support this, two different endpoints have been implemented, as explained below:
Delete a single image (DELETE /imgs/{item_id})
This endpoint allows for the deletion of data for a specific image using its unique identifier (item_id).
Parameters
In this case, the only parameter directly associated with the image to be sent is theitem_id, which, as indicated in the endpoint name, is included as a URL parameter.
The other parameters that can be sent as Query Parameters are:
| Parameter | Type | Required | Description |
|---|---|---|---|
wait | Boolean | No | Enables ‘Synchronous’ mode. When true, waits until operation completes (default: false) |
urgent | Boolean | No | Enqueue the operation associated at head of operation’s queue |
strict | Boolean | No | Enables ‘Strict’ mode. When true, fails if image ID doesn’t exist. When false, ignores missing IDs (default: false) |
Request Example
Responses
Deleting an image internally triggers an operation whose status can be queried. Accordingly, the endpoint returns all information associated with that operation, enabling the client to identify the generated operation ID and check its status thereafter.Image was deleted successfully (Response Code: 200)
If the image has been deleted successfully, all information related to the operation created to manage the image deletion will be returned, for example:Image deletion accepted but pending (Response Code: 202)
If the request has simply been accepted but is pending asynchronous execution, an object with the ID of the operation created to manage the image deletion will be returned, for example:Error in data validation (Response Code: 422)
If some error has occurred during the data validation stage, this will be shown with an error message indicating the reason for the failure, for example:Delete multiple images (DELETE /imgs)
This endpoint allows you to delete data for multiple images at once. It’s useful for efficiently removing large quantities of images.
Parameters
This endpoint maintains the sameQuery Parameters as the previous endpoint, but also allows for a request body containing the identifiers of the images to be deleted.
| Parameter | Type | Required | Description |
|---|---|---|---|
wait | Boolean | No | Enables ‘Synchronous’ mode. When true, waits until operation completes (default: false) |
strict | Boolean | No | Enables ‘Strict’ mode. When true, fails if image ID doesn’t exist. When false, ignores missing IDs (default: false) |
urgent | Boolean | No | Enables ‘Faster’ mode. When true, operation is prioritized in queue (default: false) |
id field with the identifier of the image to be deleted. For example:
| Field | Type | Required | Description |
|---|---|---|---|
id | String/Number | Yes | Unique identifier of the image to delete |
Request Example
Here is an example of how to use the Wesog Search API for deleting multiple images:Responses
Images were deleted successfully (Response Code: 200)
Similar to the scenario where only a single image is requested to be deleted from the Wesog service, in the case of deleting multiple images, if they were processed and removed from the system (or were processed and discarded due to some type of internal error), a response will be provided with a message including all relevant information related to the image deletion process.Images deletion accepted but pending (Response Code: 202)
The process of deleting a set of images usually requires more time than deleting a single image, depending on the amount of data sent to the service. For this reason, the type of response that will be shown predominantly in a short period of time after making the deletion request will be this one. As seen previously when dealing with the process of deleting a single image, the operation ID, total number of images being processed, and a secondary message providing more information about the operation’s progress are sent, if necessary.Error in validation data (Response Code: 422)
This error occurs just like in the case of the individual image, when the format of the sent message does not match the expected format, described in the request section. This happens mainly when necessary fields such asid are not included.