Saved Search¶
SavedSearch resource. Representation of a search which user wants to save and to be notified when there are new items which match this search.
Fields¶
field | type | constraints | default | Req | W | U |
---|---|---|---|---|---|---|
savedSearchId | string | – | no | no | no | |
userId | int | – | no | no | no | |
searchRequest | object | – | yes | yes | no | |
searchRequest.query | string | must be a non empty value when neither categoryId or sellerId is defined | no | yes | no | |
searchRequest.categoryId | int | positive | no | yes | no | |
searchRequest.sellerId | int | positive | no | yes | no | |
searchRequest.filters | object | – | no | yes | no | |
searchRequest.filters.price.from | int | positive | no | yes | no | |
searchRequest.filters.price.to | int | positive | no | yes | no | |
searchRequest.filters.postCode | String | postcode | no | yes | no | |
searchRequest.filters.distance | int | positive | no | yes | no | |
searchRequest.filters.{customAttributeKey} | array of strings | – | no | yes | no |
savedSearchId
Uniquely identifies a saved search
userId
Uniquely identifies a user
searchRequest
The search request object
searchRequest.filters
Search request filters object. Used to declare detailed filtering
searchRequest.filters.postCode
Postcode center of area search
searchRequest.filters.distance
Radius distance area of search from postcode in meters
searchRequest.filters.{customAttributeKey}
Any custom attribute can be used for filtering by setting an array of custom attribute values in case of simple or multiple attributes Ex: “customAttributeA” : [“customValue1”, “customValue2”]
Errors¶
http | error code | description |
---|---|---|
404 | savedsearch-not-found | There is no savedsearch for given id |
403 | unauthorized | User is not authorized to modify saved search for given id |
400 | validation-failure | Validation of the savedsearch failed. There should be more information in the field errors |
Examples¶
Retrieving a savedsearch :
Request :
GET /v1/savedsearches/123 HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/v1/savedsearches/123" } }, "id": "123", "userId": 2, "searchRequest" : { "query" : "phone", "categoryId" : 2, "sellerId" : 4, "filters" : { "price" : { "from": 10, "to": 20 }, "postCode" : "1000AB", "distance" : 1000, "searchOnDescription" : true } }, creationDate: "2014-12-19T15:03:53Z" }
Deleting a saved search :
Request :
DELETE /v1/savedsearches/1 HTTP/1.1 Host: api.marktplaats.nlResponse :
HTTP/1.1 200 OK