Backdrop image¶
Image used as the backdrop of a user’s profile page
Currently the only way to set the backdrop image is by issuing a POST against the backdrop-image resource with a post body that contains a URL. A placeholder image will be created for the uploaded image and the real image is downloaded in the background. An image will have its status attribute set to downloading until downloading completes. Clients interested in knowing when the image download has completed should poll the backdrop-image resource and wait until the status attribute changes.
See image to find out which fields are returned when issuing a GET against this resource.
Reference¶
GET /v1/users/{userId}/profile/backdrop-image
Returns the backdrop image of a user profile. Returns statuscode 404 if no backdrop image is available.
POST /v1/users/{userId}/profile/backdrop-image
Set the backdrop image of a user profile.
DELETE /v1/users/{userId}/profile/backdrop-image
Remove the backdrop image of a user profile.
Errors¶
http | error code | description |
---|---|---|
400 | validation-failure | Validation of the image failed
There should be more information in the field errors
|
Field errors¶
field | error code | error value | description |
---|---|---|---|
<field name> | field-missing | The value for this field is missing. |
Examples¶
Retrieving an image :
Request :
GET /v1/users/1/profile/backdrop-image HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/v1/images/a64976eb-4adb-4af6-aa0f-3756740d8556" }, "curies": [ { "name": "mp", "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true } ], "mp:image-meta": { "href": "/v1/images/1/{size}/meta", "templated": true }, "mp:image-blob": { "href": "/v1/images/1/{size}/blob", "templated": true } }, "imageId": 1, "mediaId": "a64976eb-4adb-4af6-aa0f-3756740d8556", "status": "downloading", "small": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_82.JPG" }, "medium": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_82.JPG" }, "large": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_83.JPG" }, "xlarge": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_84.JPG" } }
Setting the backdrop image of a user’s profile :
Request :
POST /v1/users/1/profile/backdrop-image HTTP/1.1 Host: api.marktplaats.nl Content-Type: application/json { "url": "http://remote.host/images/image1.jpg" }Response :
HTTP/1.1 202 Accepted Content-Type: application/json { "_links": { "self": { "href": "/v1/images/2b34c553-4a8f-4f0f-9c83-adc7badf6ac8" }, "curies": [ { "name": "mp", "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true } ], "mp:image-meta": { "href": "/v1/images/1/{size}/meta", "templated": true }, "mp:image-blob": { "href": "/v1/images/1/{size}/blob", "templated": true } }, "imageId": 1, "mediaId": "2b34c553-4a8f-4f0f-9c83-adc7badf6ac8", "status": "downloading", "small": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_82.JPG" }, "medium": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_82.JPG" }, "large": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_83.JPG" }, "xlarge": { "href": "https://eps.marktplaats.test/eps/8780296fd30d43c354ae83216f325610/$_84.JPG" } }
Deleting the backdrop image :
Request :
DELETE /v1/users/1/profile/backdrop-image HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK