Widgets

Fetch widgets for a spot. Returns a list of embedded Widget representations. Parameters for this request specify the details of where the widget is requested for (channel).

Parameters

name required default constraints
viewPlatform yes
page yes
position yes
contextCategoryId yes
features yes

viewPlatform

Which platform (Web, Android, etc.) the widgets are requested for. Represented by a unique identifier number.

page

Which page (VIP, LR, etc.) the widgets are requested for. Represented by a unique identifier number.

position

Which position on page (Top, Bottom, etc.) the widgets are requested for. Represented by a unique identifier number.

contextCategoryId

Which category the widgets are requested for. For example: we might not want a certain widget appear in a certain category.

features

A list of comma delimited features (context elements) for which the widgets are requested for.

Relations

name availability embedded cardinality
mp:widget always yes 1

Errors

http error code description
400 context-category-id-missing No category id provided
400 feature-missing No feature string provided
500 internal-server-error Oops! Sorry, something went wrong on our side.
400 invalid-page The page id does not exist
400 invalid-position The position id does not exist
400 invalid-view-platform The view platform id does not exist

Reference

GET /v1/widgets

Examples

Get widgets

Request :

GET /v1/widgets?viewPlatform=2&page=1&position=1&contextCategoryId=123&features=feature1,feature2 HTTP/1.1
Host: api.marktplaats.nl

Response :

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

{
  "_links": {
    "self": {
      "href": "/v1/widgets?viewPlatform=2&page=1&position=1&contextCategoryId=123&features=feature1,feature2"
    }
  },
  "_embedded": {
    "mp:widget": [
      {
        "id": "12",
        "contentType": "2",
        "contents": "<div>this is the content of a widget</div>"
      },
      {
        "id": "25",
        "contentType": "1",
        "contents": "<div>this is the content of another widget with a smiley :) </div>"
      }
    ]
  }
}