Delete a gallery image
Overview
Remove an image from the gallery.
Use this to clean up.
You'll need the image id.
The image is removed. It must belong to company_id; otherwise you get 400.
Prerequisites
- A bearer token. See Authentication.
- The account's id (
company_id). - The image's id (
image_id), from Get gallery images.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
DELETE /api/v1/account/images/delete
Authentication
Partner or Account token
company_idmust be inside your own account tree. A Partner token can use any account under the partner; an Account token only its own account.- An account outside your tree, or one that doesn't exist, is rejected with
422. - The image must belong to
company_id; otherwise400.
Rate limit
This endpoint has no rate limit.
Request parameters
None.
Request body
Sent as JSON in the body of the DELETE request.
| Field | Type | Required | Description |
|---|---|---|---|
company_id | integer | Yes | The account. Must exist and be inside your account tree. |
image_id | integer | Yes | The image to delete. Must exist and belong to company_id. |
Request payload
{
"company_id": 5994,
"image_id": 12
}Response body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
message | string | Image has been deleted successfully!. |
Response payload
{
"data": {
"status": "success",
"message": "Image has been deleted successfully!"
}
}Examples
Success payload
See Response payload.
Error payload
400 Image not found
{
"message": "Bad Request",
"status": "error",
"errors": "Image not found!"
}422 image_id is missing
{
"message": "The image id field is required.",
"errors": {
"image_id": [
"The image id field is required."
]
}
}422 image_id doesn't exist
{
"message": "The selected image id is invalid.",
"errors": {
"image_id": [
"The selected image id is invalid."
]
}
}422 Account outside your tree
{
"message": "The selected company id does not belong to your company hierarchy.",
"errors": {
"company_id": [
"The selected company id does not belong to your company hierarchy."
]
}
}| Status | Meaning |
|---|---|
200 | The image was deleted. |
400 | The image doesn't belong to company_id. |
401 | The token is missing, expired or invalid. |
422 | company_id or image_id is missing or doesn't exist, or company_id is outside your tree. |
500 | Unexpected server error. |
Example request
curl --request DELETE \
--url "https://production-api.shoutaboutus.com/api/v1/account/images/delete" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"company_id": 5994, "image_id": 12}'Updated 17 days ago
Did this page help you?
