Create Image
- Use
POST
http method.
None
None
curl -u 15:wcrG8WPPWaq9Ndiesbjn https://api.bukalapak.com/v1/images.json -F file=@product-image.png -X POST
Success response:
{
"status":"OK",
"id": "157324",
"message":null
}
Failed response
{
"status":"ERROR",
"user_id":"null",
"message":"Harus berupa file gambar"
}
Check image status whether it has been assigned to a product or not.
- Use
GET
http method.
id
(required). Image identifier.
curl -u 15:wcrG8WPPWaq9Ndiesbjn https://api.bukalapak.com/v1/images/status/181244.json
Response for image without product:
{
"status":"OK",
"id":1838301,
"message":"Orphaned"
}
Response for image that has been assigned to product.
{
"status":"ERROR",
"user_id":1838301,
"message":"Assigned"
}
Delete image.
- Use
DELETE
http method.
id
(required). Image identifier.
curl -u 15:wcrG8WPPWaq9Ndiesbjn -X DELETE https://api.bukalapak.com/v1/images/181244.json
Response when deleting image:
{
"status":"OK",
"id":1838301,
"message":"Image deleted"
}
Response for nonexistent image.
{
"status":"ERROR",
"user_id":1838301,
"message":"Failed to delete image"
}
Response when trying to delete another user's image.
{
"status":"ERROR",
"user_id":1838301,
"message":"Can't delete another user's image"
}