Logo image

Image used as the logo of a user’s profile page

Currently the only way to set the logo image is by issuing a POST against the logo-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 logo-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/logo-image

Returns the logo image of a user profile. Returns statuscode 404 if no logo image is available.

POST /v1/users/{userId}/profile/logo-image

Set the logo image of a user profile.

DELETE /v1/users/{userId}/profile/logo-image

Remove the logo 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/logo-image HTTP/1.1
Host: api.marktplaats.nl

Response :

HTTP/1.1 200 OK
Content-Type: application/json

{
  "_links": {
     "self": { "href": "/v1/images/7a0bc672-7af1-4b12-8c55-5347a80c8bbd" },
     "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": "7a0bc672-7af1-4b12-8c55-5347a80c8bbd",
  "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 logo picture of a user:

Request :

POST /v1/users/1/profile/logo-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 logo image :

Request :

DELETE /v1/users/1/profile/logo-image HTTP/1.1
Host: api.marktplaats.nl

Response :

HTTP/1.1 200 OK