User advertisements

Collection of advertisement representations. Returning advertisements of the user. The requested advertisements will be returned as embedded resources.

Note

The embeded advertisements do not contain attribute values at this moment

Query Parameters

name required default constraints
offset no 0
limit no 100

offset

0 based index of the first element to return in the response, currently has to be a multiple of the limit value eg. when the limit is 10, then 10, 20, 30 are allowed 11 is not

limit

maximum number of contained elements to return in the response

Relations

name availability embedded cardinality
mp:advertisement always yes 0..N

Reference

GET /v1/users/{userId}/advertisements

Get all the advertisement of the user. Note that this only works on the logged in user. Defaults to offset 0 and limit 100.

GET /v1/users/{userId}/advertisements?offset={offset}&limit={limit}

Get all the advertisement of the user. Note that this only works on the logged in user. You can supply your own offset an limit. The offset is the number of ads that should be skipped, the limit is the max amount of advertisements that you want to return. The limit cannot be greater than 100. In order for pagination to work, the offset should be a multitude of the limit. For example:

valid offsets

offset 0, limit 10
offset 10, limit 10
offset 100, limit 10
offset 12, limit 6
invalid offsets

offset 2, limit 10
offset 8, limit 10
offset -1, limit 10
offset 5, limit 6

You will receive a 400 response with pagination-invalid if you supply an offset and limit that we cannot support.

Errors

http error code description
400 pagination-invalid The pagination offset and limit need to match, offset should be a multitude of limit.
401 unauthorized The userId is not of the currently logged in user

Examples

Retrieving all advertisements :

Request :

GET /v1/users/1/advertisements?limit=1&offset=1 HTTP/1.1
Host: api.marktplaats.nl

Response :

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

{
   "_links": {
       "self": {
         "href": "/v1/users/1/advertisements?limit=1&offset=1"
       },
       "first": {
         "href": "/v1/users/1/advertisements?limit=1&offset=0"
       },
       "last": {
         "href": "/v1/users/1/advertisements?limit=1&offset=4"
       },
       "next": {
         "href": "/v1/users/1/advertisements?limit=1&offset=2"
       },
       "prev": {
         "href": "/v1/users/1/advertisements?limit=1&offset=0"
       },
       "describedby": {
         "href": "https://api.marktplaats.nl/docs/v1/user-advertisements.html"
       },
       "curies": [
         {
           "href": "https://api.marktplaats.nl/docs/v1/rels/{rel}.html",
           "templated": true,
           "name": "mp"
         }
       ]
  },
  "_embedded": {
     "mp:advertisements":[
        {
           "_links":{
              "self":{
                 "href":"/v1/advertisements/m1"
              },
              "describedby":{
                 "href":"https://api.marktplaats.nl/docs/v1/advertisement.html"
              },
              "mp:category":{
                 "href":"/v1/categories/91/112"
              },
              "mp:seller":{
                 "href":"/v1/users/1"
              },
              "mp:advertisement-features":{
                 "href":"/v1/advertisements/m1/features"
              },
              "mp:advertisement-images":{
                 "href":"/v1/advertisements/m1/images"
              },
              "mp:advertisement-statistics":{
                 "href":"/v1/advertisements/m1/statistics"
              },
              "mp:bids":{
                 "href":"/v1/advertisements/m1/bids"
              },
              "mp:advertisement-transactions":{
                 "href":"/v1/advertisements/m1/transactions"
              }
           },
           "itemId":"m1",
           "title":"Ford Transit 2.0 260",
           "description":"My special ford",
           "categoryId":112,
           "priceModel":{
              "modelType":"fixed",
              "askingPrice":12312300
           },
           "location":{
              "postcode":"8302JM",
              "cityName":"Emmeloord"
           },
           "seller":{
              "sellerId":1,
              "sellerName":"Richard"
           },
           "url": "http://www.acdezandhorst.nl/",
           "startDate": "2014-09-30T15:56:25Z",
           "closeDate": "2014-10-28T15:56:25Z",
           "model": "Transit",
           "constructionYear": 2008,
           "fuel": "Diesel",
           "mileage": 166640,
           "body": "Gesloten Wagen",
           "transmission": "Handgeschakeld",
           "color": "Zwart",
           "engineDisplacement": 2446,
           "napNationalCarPass": "Ja",
           "makeDescription": "Ford",
           "modelDescription": "Transit",
           "apkExpirationDate": "2014-11-04",
           "apkOnDelivery": "Nee"
     }]
  },
  "offset": 1,
  "limit": 1,
  "totalCount": 4
}