Platitun · API · Listings · The listing image
The listing image
PUT /api/v1/listings/{number}/imageKey scope: listings · changes data, the Idempotency-Key header is required
The request body is the image BYTES themselves, not JSON: that is what the cabinet form does too. The file type is determined by content, not by name and not by header: the header cannot be trusted here.
Request fields
| Field | Type | What it is |
|---|---|---|
(тело) required | binary | The image bytes. Ordinary image formats are allowed; the size limit is the same as in the cabinet. |
Response fields
| Field | Type | What it is |
|---|---|---|
image | string | The stored file name. |
Refusal reasons
A rule refusal arrives as {"error":"rejected","refusal":{"kind":"…"}} with status 409. Refusals common to all endpoints are in the rules section.
| Code | What happened and what to do |
|---|---|
not_found | The record does not exist or is not yours. The ownership condition is in the database query itself, so someone else’s record looks like a missing one. |
image_too_big | The image exceeds the allowed size. Shrink it and send again. |
image_bad_type | This is not an image of an allowed type. The type is determined by file content, not by name: renaming will not help. |
Nearby in this section
GET /api/v1/listings— My listingsPOST /api/v1/listings— Create a listingGET /api/v1/listings/{number}— One of my listingsPATCH /api/v1/listings/{number}— Update a listingDELETE /api/v1/listings/{number}— Remove a listingPOST /api/v1/listings/{number}/state— Switch on, switch off, auto-deliveryPOST /api/v1/listings/{number}/copy— Copy a listingPOST /api/v1/listings/{number}/test— Mark a listing as testDELETE /api/v1/listings/{number}/image— Remove the imageGET /api/v1/questions— Questions about my listingsPOST /api/v1/questions/{id}/answer— Answer a question