### GET /v1/me Example Source: https://api.marktplaats.nl/docs/v1/_sources/me.rst.txt This example demonstrates how to make a GET request to the /v1/me endpoint to retrieve information about the logged-in user. ```http GET /v1/me HTTP/1.1 Host: api.marktplaats.nl Accept: application/json ``` -------------------------------- ### Get User Reviews Example Source: https://api.marktplaats.nl/docs/v1/_sources/user-reviews.rst.txt This example demonstrates how to make a GET request to retrieve user reviews for a specific user ID. ```bash curl -X GET "https://api.marktplaats.nl/v1/users/{userId}/reviews" ``` -------------------------------- ### Get User Reviews Example Source: https://api.marktplaats.nl/docs/v1/_sources/user-review.rst.txt This example demonstrates how to retrieve user reviews. Ensure you have the necessary authentication and endpoint configured. ```python from datetime import datetime from dateutil.parser import isoparse from odoo.addons.component.core import Component from odoo.addons.component.service import Service from odoo.addons.component.decorator import implements from odoo.addons.component.exception import InvalidHandler from odoo.addons.api_marktplaats_nl_v1.services.user_review.user_review_service import UserReviewService class GetUserReviewsExample(Component): implements(Service) def get_user_reviews(self, params=None): """ Get user reviews :param params: dict :return: dict """ if params is None: params = {} user_review_service = UserReviewService(self.env) return user_review_service.get_user_reviews(params) # Example usage: # from odoo.api import Environment # env = Environment(cr, uid, context) # get_user_reviews_example = GetUserReviewsExample(env) # result = get_user_reviews_example.get_user_reviews({'user_id': 123}) # print(result) ``` -------------------------------- ### GET Advertisement Example Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement.rst.txt Example of how to retrieve an advertisement using the API. ```bash curl -X GET https://api.marktplaats.nl/v1/ads/123456789 ``` -------------------------------- ### Example GET Category Request Source: https://api.marktplaats.nl/docs/v1/_sources/category.rst.txt This example demonstrates how to retrieve category information using the API. ```bash curl -X GET https://api.marktplaats.nl/v1/categories/1000 ``` -------------------------------- ### Get Advertisement Transaction Example Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement-transaction.rst.txt This example demonstrates how to retrieve a specific transaction for an advertisement. Ensure you have the correct advertisement and transaction IDs. ```bash curl -X GET https://api.marktplaats.nl/v1/advertisements/123456789/transactions/987654321 ``` -------------------------------- ### Get Root Resource Example Source: https://api.marktplaats.nl/docs/v1/_sources/root.rst.txt This example demonstrates how to fetch the root resource of the API. It shows the expected response structure, including available relations. ```http GET / HTTP/1.1 Host: api.marktplaats.nl Accept: application/json ``` ```json { "_links": { "self": {"href": "/"}, "mp:advertisements": {"href": "/advertisements"}, "mp:categories": {"href": "/categories"}, "mp:users": {"href": "/users"}, "mp:me": {"href": "/me"}, "mp:locations": {"href": "/locations"}, "mp:searches": {"href": "/searches"} } } ``` -------------------------------- ### Get Image Example Source: https://api.marktplaats.nl/docs/v1/_sources/image.rst.txt Example of how to retrieve image information using the API. This snippet demonstrates a typical GET request to the /v1/images/{mediaId} endpoint. ```http GET /v1/images/a1b2c3d4-e5f6-7890-1234-567890abcdef HTTP/1.1 Host: api.marktplaats.nl Accept: application/json ``` -------------------------------- ### Buy Advertisement Feature Example Source: https://api.marktplaats.nl/docs/v1/_sources/buy-advertisement-feature.rst.txt This example demonstrates how to purchase a feature for an advertisement using the API. Ensure the authenticated user owns the advertisement. ```bash curl -X POST https://api.marktplaats.nl/v1/advertisements/12345/features/highlight/buy-feature \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{"pay": true}' ``` -------------------------------- ### See Description Price Model Example Source: https://api.marktplaats.nl/docs/v1/reference/price-models.html Example of a 'see description' price model, where price details are in the item description. ```json ... "priceModel" : { "modelType" : "see description" } ... ``` -------------------------------- ### PUT Advertisement Example Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement.rst.txt Example of updating an advertisement using the PUT method. The full advertisement object must be provided in the request body. ```json { "title": "Updated advertisement title", "description": "This is the updated description.", "priceModel": { "type": "fixed", "price": 100.00 }, "attributes": [ { "key": "color", "value": "red" } ] } ``` -------------------------------- ### Bidding Price Model Example Source: https://api.marktplaats.nl/docs/v1/reference/price-models.html Example of a 'bidding' price model, including minimal bid, asking price, and retail price. ```json ... "priceModel" : { "modelType" : "bidding", "minimalBid" : 2000, "askingPrice" : 5550, "retailPrice" : 6000 } ... ``` -------------------------------- ### Retrieve Order Example Source: https://api.marktplaats.nl/docs/v1/_sources/order.rst.txt Example of how to retrieve a single order using its orderId. This snippet demonstrates a GET request to the /v1/orders/{orderId} endpoint. ```bash curl -X GET https://api.marktplaats.nl/v1/orders/12345 ``` -------------------------------- ### Search Response Example Source: https://api.marktplaats.nl/docs/v1/search-advertisements.html This is an example of a successful response to a search query, detailing the embedded search results, links, and pagination information. ```json HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/v1/search?query=batmobile&offset=0&limit=30" }, "curies": [ { "href": "https://api.marktplaats.nl/docs/v1/rels/{rel}.html", "templated": true, "name": "mp" } ] }, "_embedded": { "mp:search-result": [ { "_links": { "mp:advertisement": { "href": "/v1/advertisements/m459" }, "mp:category": { "href": "/v1/categories/1/2" }, "mp:seller": { "href": "/v1/users/231" }, "mp:advertisement-website-link": { "href": "http://link.marktplaats.nl/m459", "type": "text/html" } }, "_embedded": { "mp:advertisement-image": { "_links": { "self": { "href": "/v1/images/857ca3aa-da33-4faf-b7eb-2eca6068d609" }, "mp:image-blob": { "href": "/v1/images/857ca3aa-da33-4faf-b7eb-2eca6068d609/{size}/blob", "templated": true }, "mp:image-meta": { "href": "/v1/images/857ca3aa-da33-4faf-b7eb-2eca6068d609/{size}/meta", "templated": true } }, "imageId": 19, "mediaId": "857ca3aa-da33-4faf-b7eb-2eca6068d609", "status": "available" } }, "itemId": "m459", "title": "batmobile", "description": "batmobile", "categoryId": 2, "priceModel": { "modelType": "fixed", "askingPrice": 34200 }, "seller": { "sellerId": 231, "sellerName": "Batman" } } ] }, "query": "batmobile", "offset": 0, "limit": 10, "totalCount": 1 } ``` -------------------------------- ### Fixed Price Model Example Source: https://api.marktplaats.nl/docs/v1/reference/price-models.html Example of a 'fixed' price model, specifying the asking price for an item. ```json ... "priceModel" : { "modelType" : "fixed", "askingPrice" : 1550 } ... ``` -------------------------------- ### Create Saved Search Example Source: https://api.marktplaats.nl/docs/v1/_sources/savedsearches.rst.txt Example of creating a new saved search. Ensure the request body conforms to the savedsearch resource documentation. ```json { "name": "My Saved Search", "query": { "keywords": "example" } } ``` -------------------------------- ### Renew Advertisement Example Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement-renew.rst.txt This example demonstrates how to renew an advertisement. Ensure the 'pay' parameter is set to true for immediate payment via invoicing, as only this option is currently supported. ```bash curl -X POST https://api.marktplaats.nl/v1/advertisements/12345/renew \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -d '{"pay": true}' ``` -------------------------------- ### DELETE Advertisement Example Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement.rst.txt Example of how to delete an advertisement using the API. ```bash curl -X DELETE https://api.marktplaats.nl/v1/ads/123456789 ``` -------------------------------- ### Get Bids for Advertisement Source: https://api.marktplaats.nl/docs/v1/_sources/bids.rst.txt Retrieves all bids placed on an advertisement, ordered by bid amount. This example demonstrates a typical API request. ```http GET /v1/advertisements/12345/bids HTTP/1.1 Host: api.marktplaats.nl Accept: application/vnd.api+json ``` -------------------------------- ### Performing a search Source: https://api.marktplaats.nl/docs/v1/search-advertisements.html This example demonstrates how to perform a basic search for advertisements using query parameters. ```APIDOC ## GET /v1/search ### Description Performs a search for advertisements based on provided query parameters. ### Method GET ### Endpoint /v1/search ### Query Parameters - **categoryId** (integer) - Required - The ID of the category to search within. - **query** (string) - Required - The search term. - **offset** (integer) - Optional - The number of results to skip. - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example ``` GET /v1/search?categoryId=92&query=car&offset=0&limit=10 HTTP/1.1 Host: api.marktplaats.nl ``` ### Response #### Success Response (200) - **_links** (object) - Links related to the search results. - **_embedded** (object) - Embedded resources, typically a list of search results. - **query** (string) - The search query used. - **offset** (integer) - The offset used for pagination. - **limit** (integer) - The limit used for pagination. - **totalCount** (integer) - The total number of results found. #### Response Example ```json { "_links": { "self": { "href": "/v1/search?query=batmobile&offset=0&limit=30" }, "curies": [ { "href": "https://api.marktplaats.nl/docs/v1/rels/{rel}.html", "templated": true, "name": "mp" } ] }, "_embedded": { "mp:search-result": [ { "_links": { "mp:advertisement": { "href": "/v1/advertisements/m459" }, "mp:category": { "href": "/v1/categories/1/2" }, "mp:seller": { "href": "/v1/users/231" }, "mp:advertisement-website-link": { "href": "http://link.marktplaats.nl/m459", "type": "text/html" } }, "_embedded": { "mp:advertisement-image": { "_links": { "self": { "href": "/v1/images/857ca3aa-da33-4faf-b7eb-2eca6068d609" }, "mp:image-blob": { "href": "/v1/images/857ca3aa-da33-4faf-b7eb-2eca6068d609/{size}/blob", "templated": true }, "mp:image-meta": { "href": "/v1/images/857ca3aa-da33-4faf-b7eb-2eca6068d609/{size}/meta", "templated": true } }, "imageId": 19, "mediaId": "857ca3aa-da33-4faf-b7eb-2eca6068d609", "status": "available" } }, "itemId": "m459", "title": "batmobile", "description": "batmobile", "categoryId": 2, "priceModel": { "modelType": "fixed", "askingPrice": 34200 }, "seller": { "sellerId": 231, "sellerName": "Batman" } } ] }, "query": "batmobile", "offset": 0, "limit": 10, "totalCount": 1 } ``` ``` -------------------------------- ### PATCH Advertisement with JSON Patch Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement.rst.txt Example of updating an advertisement using the PATCH method with JSON Patch format. This example replaces the title. ```json [ { "op": "replace", "path": "/title", "value": "New advertisement title" } ] ``` -------------------------------- ### Simple Search Request Source: https://api.marktplaats.nl/docs/v1/_sources/search-advertisements.rst.txt A basic example of a search request. This snippet is included from an external file. ```http GET /v1/search?query=bicycle&limit=10&offset=0 HTTP/1.1 Host: api.marktplaats.nl Accept: application/json ``` -------------------------------- ### Get Specific Product in Order Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific product within a given order. ```APIDOC ## GET /v1/orders/{orderId}/products/{productId} ### Description Retrieves details of a specific product within a given order. ### Method GET ### Endpoint /v1/orders/{orderId}/products/{productId} ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order. - **productId** (string) - Required - The unique identifier of the product. ``` -------------------------------- ### Running Subscriptions Example Source: https://api.marktplaats.nl/docs/v1/_sources/reference/running-subscriptions.rst.txt Shows the structure of running subscription fees, including duration in days and the fee in Euro cents. ```javascript ... "runningSubscriptions": [ { "durationDays": 7, "fee": 1250 }, { "durationDays": 14, "fee": 1750 }, { "durationDays": 28, "fee": 2500 } ] ... ``` -------------------------------- ### Billing Status Example Source: https://api.marktplaats.nl/docs/v1/reference/billing.html Shows the structure for representing a user's billing status, including profile state and an optional follow link. ```json { "billing": { "profile": "Incomplete", "followLink": "https://www.marktplaats.nl/gegevens" } } ``` -------------------------------- ### GET Specific Transaction for an Advertisement Source: https://api.marktplaats.nl/docs/v1/advertisement-transaction.html Retrieves a specific transaction associated with an advertisement. Use this endpoint to get details of a particular transaction. ```HTTP GET /v1/advertisements/m1/transactions/2 HTTP/1.1 Host: api.marktplaats.nl ``` ```JSON { "_links": { "self": { "href": "/v1/advertisements/m1/transactions/2" } }, "transactionId": 2, "buyerId": 6789, "amount": 1200, "shippingCosts": 100, "status": "COMPLETED" } ``` -------------------------------- ### See Description Price Model Example Source: https://api.marktplaats.nl/docs/v1/_sources/reference/price-models.rst.txt Use this model when the price information is detailed within the item's description. No additional price-related fields are required. ```javascript ... "priceModel" : { "modelType" : "see description" } ... ``` -------------------------------- ### Create User Source: https://api.marktplaats.nl/docs/v1/endpoints.html Creates a new user. ```APIDOC ## POST /v1/users ### Description Creates a new user. ### Method POST ### Endpoint /v1/users ``` -------------------------------- ### Bidding Price Model Example Source: https://api.marktplaats.nl/docs/v1/_sources/reference/price-models.rst.txt This model is used when a seller wants to allow bidding on an item. 'minimalBid' and 'askingPrice' are optional but have specific requirements if provided. 'retailPrice' is only writable with specific privileges. ```javascript ... "priceModel" : { "modelType" : "bidding", "minimalBid" : 2000, "askingPrice" : 5550, "retailPrice" : 6000 } ... ``` -------------------------------- ### Retrieve Authenticated User (GET /v1/me) Source: https://api.marktplaats.nl/docs/v1/me.html Use this endpoint to get a redirect to the currently authenticated user's resource. The response is a 302 redirect. ```http GET /v1/me HTTP/1.1 Host: api.marktplaats.nl ``` ```http HTTP/1.1 302 Moved Temporarily Location: /v1/users/1 ``` -------------------------------- ### GET Request for Advertisement Bids Source: https://api.marktplaats.nl/docs/v1/bids.html Use this GET request to retrieve all bids placed on a specific advertisement. The bids are returned ordered by bid amount. ```http GET /v1/advertisements/m1/bids HTTP/1.1 Host: api.marktplaats.nl ``` -------------------------------- ### Create User Account Source: https://api.marktplaats.nl/docs/v1/users.html Creates a new user account. Requires client authentication with the `create_account` scope. ```APIDOC ## POST /v1/users ### Description Create a new user. New users will not be able to log in until they confirm their email address. It is not possible to specify a password during creation. ### Method POST ### Endpoint /v1/users ### Parameters #### Request Body - **email** (string) - Required - The email address of the user. - **name** (string) - Required - The name of the user. - **postcode** (string) - Required - The postcode of the user. - **phoneNumber** (string) - Required - The phone number of the user. ### Request Example { "email": "user@host.nl", "name": "Spiderman", "postcode": "1097DN", "phoneNumber": "0204167248" } ### Response #### Success Response (201) - **userId** (integer) - The unique identifier for the created user. - **email** (string) - The email address of the user. - **name** (string) - The name of the user. - **postcode** (string) - The postcode of the user. - **phoneNumber** (string) - The phone number of the user. - **status** (string) - The status of the user account (e.g., "confirmed"). - **_links** (object) - Links to related resources. #### Response Example { "_links": { "self": { "href": "/v1/users/3078" }, "curies": [ { "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true, "name": "mp" } ] }, "userId": 3078, "email": "user@host.nl", "name": "Spiderman", "postcode": "1097DN", "phoneNumber": "0204167248", "status": "confirmed" } ``` -------------------------------- ### Advertisement Transaction Notification Example Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement-transaction.rst.txt This is an example of the JSON structure Marktplaats sends for transaction status changes. Third-party services should be prepared to receive and process these notifications. ```json { "transactionId": 987654321, "itemId": 123456789, "status": "paid", "buyerId": 111111111, "amount": 10000, "shippingCosts": 500, "currency": "EUR", "timestamp": "2023-01-01T12:00:00Z" } ``` -------------------------------- ### Get Advertisements Source: https://api.marktplaats.nl/docs/v1/_sources/advertisements.rst.txt Retrieves a collection of advertisements. ```APIDOC ## GET /v1/advertisements ### Description Collection of advertisements. ### Method GET ### Endpoint /v1/advertisements ``` -------------------------------- ### Load Image Binary Source: https://api.marktplaats.nl/docs/v1/_sources/image-blob.rst.txt Use this endpoint to retrieve the raw binary data of an image. Ensure you specify the correct media ID and desired size. ```bash GET /v1/images/{mediaId}/{size}/blob ``` -------------------------------- ### Create New User Account Source: https://api.marktplaats.nl/docs/v1/users.html Use this POST request to create a new user account. Clients must authenticate with a token having the `create_account` scope. The response includes the userId and details of the created user. ```http POST /v1/users HTTP/1.1 Host: api.marktplaats.nl Content-Type: application/json { "email": "user@host.nl", "name": "Spiderman", "postcode": "1097DN", "phoneNumber": "0204167248" } ``` ```json HTTP/1.1 201 OK Content-Type: application/json Location: /v1/users/3078 { "_links": { "self": { "href": "/v1/users/3078" }, "curies": [ { "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true, "name": "mp" } ] }, "userId": 3078, "email": "user@host.nl", "name": "Spiderman", "postcode": "1097DN", "phoneNumber": "0204167248", "status": "confirmed" } ``` -------------------------------- ### Get Transactions Source: https://api.marktplaats.nl/docs/v1/advertisement-transactions.html Retrieves all transactions for a specific advertisement. ```APIDOC ## GET /v1/advertisements/{itemId}/transactions ### Description Returns all transactions on the advertisement ordered by transactionId. ### Method GET ### Endpoint /v1/advertisements/{itemId}/transactions ### Response #### Success Response (200) - **_links** (object) - Links related to the response. - **_embedded** (object) - Embedded resources. - **mp:advertisement-transaction** (array) - An array of transaction objects. - **_links** (object) - Links related to the transaction. - **transactionId** (integer) - The ID of the transaction. - **buyerId** (integer) - The ID of the buyer. - **amount** (integer) - The transaction amount. - **shippingCosts** (integer) - The shipping costs. - **status** (string) - The status of the transaction. #### Response Example ```json { "_links": { "self": { "href": "/v1/advertisements/m1/transactions" }, "curies": [ { "name": "mp", "href": "https://api.marktplaats.nl/docs/v1/{rel}.html", "templated": true } ] }, "_embedded": { "mp:advertisement-transaction": [ { "_links": { "self": { "href": "/v1/advertisements/m1/transactions/105" } }, "transactionId": 105, "buyerId": 6789, "amount": 1200, "shippingCosts": 100, "status": "COMPLETED" }, { "_links": { "self": { "href": "/v1/advertisements/m1/transactions/101" } }, "transactionId": 101, "buyerId": 3587, "amount": 1200, "shippingCosts": 100, "status": "CANCELLED" } ] } } ``` ``` -------------------------------- ### Get Advertisement Features Source: https://api.marktplaats.nl/docs/v1/_sources/advertisement-features.rst.txt Retrieves all the features for a given advertisement. ```APIDOC ## GET /v1/advertisements/{itemId}/features ### Description Get all the features for a given advertisement. ### Method GET ### Endpoint /v1/advertisements/{itemId}/features ### Parameters #### Path Parameters - **itemId** (string) - Required - The ID of the advertisement. ``` -------------------------------- ### Get User by ID Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific user by their ID. ```APIDOC ## GET /v1/users/{userId} ### Description Retrieves details of a specific user by their ID. ### Method GET ### Endpoint /v1/users/{userId} ### Parameters #### Path Parameters - **userId** (string) - Required - The unique identifier of the user. ``` -------------------------------- ### Valid Pagination Offsets Source: https://api.marktplaats.nl/docs/v1/_sources/user-advertisements.rst.txt Examples of valid offset and limit combinations for paginating user advertisements. Ensure the offset is a multiple of the limit for correct pagination. ```http offset 0, limit 10 offset 10, limit 10 offset 100, limit 10 ``` -------------------------------- ### Load Image Binary Source: https://api.marktplaats.nl/docs/v1/image-blob.html Use this endpoint to load the image binary. The response will be a redirect to the image file. ```http GET /v1/images/a64976eb-4adb-4af6-aa0f-3756740d8556/medium/blob HTTP/1.1 Host: api.marktplaats.nl ``` ```http HTTP/1.1 301 Moved Permanently Location: http://i.marktplaats.com/00/s/NTAwWDM3NQ==/z/LMEAAOxyBjBTWNMb/$_84.JPG ``` -------------------------------- ### Get Order by ID Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific order by its ID. ```APIDOC ## GET /v1/orders/{orderId} ### Description Retrieves details of a specific order by its ID. ### Method GET ### Endpoint /v1/orders/{orderId} ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order. ``` -------------------------------- ### Get Saved Search Source: https://api.marktplaats.nl/docs/v1/savedsearch.html Retrieves a specific saved search by its ID. ```APIDOC ## GET /v1/savedsearches/{savedSearchId} ### Description Get a savedSearch. ### Method GET ### Endpoint /v1/savedsearches/{savedSearchId} ### Parameters #### Path Parameters - **savedSearchId** (string) - Required - Uniquely identifies a saved search ### Response #### Success Response (200) - **_links** (object) - Links related to the saved search - **id** (string) - The unique identifier of the saved search - **userId** (int) - The unique identifier of the user who created the saved search - **searchRequest** (object) - The search criteria object - **query** (string) - The search query string - **categoryId** (int) - The category ID for the search - **sellerId** (int) - The seller ID for the search - **filters** (object) - Filtering options for the search - **price** (object) - Price range filter - **from** (int) - Minimum price - **to** (int) - Maximum price - **postCode** (string) - Postcode for area-based search - **distance** (int) - Search radius in meters from the postcode - **searchOnDescription** (boolean) - Whether to search within the item description ### Response Example ```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" } ``` ``` -------------------------------- ### Billing Object Example Source: https://api.marktplaats.nl/docs/v1/_sources/reference/billing.rst.txt Represents the billing status of a user. Use this when the user's profile is 'Incomplete' and a follow link is provided. ```javascript "billing": { "profile": "Incomplete", "followLink": "https://www.marktplaats.nl/gegevens" } ``` -------------------------------- ### List Products in Order Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves a list of products included in a specific order. ```APIDOC ## GET /v1/orders/{orderId}/products ### Description Retrieves a list of products included in a specific order. ### Method GET ### Endpoint /v1/orders/{orderId}/products ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order. ``` -------------------------------- ### Get Image Metadata Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves metadata for an image in a specified size. ```APIDOC ## GET /v1/images/{mediaId}/{size}/meta ### Description Retrieves metadata for an image in a specified size. ### Method GET ### Endpoint /v1/images/{mediaId}/{size}/meta ### Parameters #### Path Parameters - **mediaId** (string) - Required - The unique identifier of the image media. - **size** (string) - Required - The desired size of the image for which to retrieve metadata. ``` -------------------------------- ### Create User Source: https://api.marktplaats.nl/docs/v1/_sources/users.rst.txt Creates a new user account. New users must confirm their email address to log in. A password cannot be specified during creation. ```APIDOC ## POST /v1/users ### Description Create a new user account. New users will not be able to log in to the site until they have confirmed their email address by clicking a link contained in an email sent to their address. It is not possible to specify a password when creating an account. ### Method POST ### Endpoint /v1/users ### Parameters #### Request Body - **email** (string) - Required - The email address for the new user. - **client_id** (string) - Required - The ID of the client creating the user. ### Request Example { "email": "user@example.com", "client_id": "your_client_id" } ### Response #### Success Response (201) - **id** (string) - The unique identifier for the newly created user. - **email** (string) - The email address of the user. - **created_at** (datetime) - The timestamp when the user was created. #### Response Example { "id": "usr_12345abcde", "email": "user@example.com", "created_at": "2023-10-27T10:00:00Z" } ``` -------------------------------- ### Get Category by ID Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific category by its ID. ```APIDOC ## GET /v1/categories/{categoryId} ### Description Retrieves details of a specific category by its ID. ### Method GET ### Endpoint /v1/categories/{categoryId} ### Parameters #### Path Parameters - **categoryId** (string) - Required - The unique identifier of the category. ``` -------------------------------- ### Fixed Price Model Example Source: https://api.marktplaats.nl/docs/v1/_sources/reference/price-models.rst.txt Use this model when a seller wants to specify a fixed price for an item. The 'askingPrice' field is mandatory. ```javascript ... "priceModel" : { "modelType" : "fixed", "askingPrice" : 1550 } ... ``` -------------------------------- ### Get Bid by ID Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific bid for an advertisement. ```APIDOC ## GET /v1/advertisements/{itemId}/bids/{bidId} ### Description Retrieves details of a specific bid for an advertisement. ### Method GET ### Endpoint /v1/advertisements/{itemId}/bids/{bidId} ### Parameters #### Path Parameters - **itemId** (string) - Required - The unique identifier of the advertisement. - **bidId** (string) - Required - The unique identifier of the bid. ``` -------------------------------- ### Get Advertisement Images Source: https://api.marktplaats.nl/docs/v1/advertisement-images.html Retrieves all images associated with a specific advertisement. ```APIDOC ## GET /v1/advertisements/{id}/images ### Description Retrieves all images for a given advertisement. ### Method GET ### Endpoint /v1/advertisements/{id}/images ### Response #### Success Response (200) - **_links** (object) - Links to related resources. - **_embedded** (object) - Contains the advertisement image data. - **mp:advertisement-image** (array) - An array of advertisement image objects. - **_links** (object) - Links for individual images. - **small** (object) - URL for the small version of the image. - **medium** (object) - URL for the medium version of the image. - **large** (object) - URL for the large version of the image. - **xlarge** (object) - URL for the extra-large version of the image. - **imageId** (integer) - The ID of the image. - **mediaId** (string) - The media ID of the image. ### Response Example ```json { "_links":{ "self":{ "href":"/v1/advertisements/m1/images" }, "curies":[ { "name":"mp", "href":"https://api.marktplaats.nl/docs/v1/{rel}.html", "templated":true } ] }, "_embedded":{ "mp:advertisement-image":[ { "_links":{ "self":{ "href":"/v1/images/ec494827-ed10-4f43-ba15-2114f7360a8b" }, "mp:image-meta":{ "href":"/v1/images/ec494827-ed10-4f43-ba15-2114f7360a8b/{size}/meta", "templated":true }, "mp:image-blob":{ "href":"/v1/images/ec494827-ed10-4f43-ba15-2114f7360a8b/{size}/blob", "templated":true } }, "small":{ "href":"http://i.marktplaats.com/00/s/NTQwWDgwMA==/z/QZEREAOSwDuJWv5QR/$_14.JPG" }, "medium":{ "href":"http://i.marktplaats.com/00/s/NTQwWDgwMA==/z/QZEREAOSwDuJWv5QR/$_83.JPG" }, "large":{ "href":"http://i.marktplaats.com/00/s/NTQwWDgwMA==/z/QZEREAOSwDuJWv5QR/$_84.JPG" }, "xlarge":{ "href":"http://i.marktplaats.com/00/s/NTQwWDgwMA==/z/QZEREAOSwDuJWv5QR/$_85.JPG" }, "imageId":100, "mediaId":"ec494827-ed10-4f43-ba15-2114f7360a8b" } ] } } ``` ``` -------------------------------- ### Get Advertisement by ID Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific advertisement by its ID. ```APIDOC ## GET /v1/advertisements/{itemId} ### Description Retrieves details of a specific advertisement by its ID. ### Method GET ### Endpoint /v1/advertisements/{itemId} ### Parameters #### Path Parameters - **itemId** (string) - Required - The unique identifier of the advertisement. ``` -------------------------------- ### Step 1: Redirect to the authorization URL Source: https://api.marktplaats.nl/docs/v1/authentication.html Initiates the OAuth 2.0 flow by redirecting the user to the authorization endpoint with required and optional GET parameters. ```APIDOC ## Step 1: Redirect to the authorization URL ### Description Redirect the resource owner (user) to the authorization URL with the following GET parameters. ### Parameters #### Query Parameters - **response_type** (string) - Required - Must be set to `code`. - **client_id** (string) - Required - ClientId assigned by Marktplaats. - **scope** (string) - Optional - Additional, optional scopes of the request. If not filled in, the scope of the access token will be the default scopes registered for your Client. - **state** (string) - Optional, but recommended - Any client state that needs to be passed on to the client request URI. This will be appended as a state query param to the redirect_uri. - **redirect_uri** (string) - Required - The URL to which the authorization server redirects the user with an authorization code after successful authorization. The `redirect_uri` should exactly match one of the URIs registered with the client. Query parameters can be added to this URI, but should not be named `code`. ``` -------------------------------- ### Get User Brands Source: https://api.marktplaats.nl/docs/v1/_sources/user-brands.rst.txt Retrieves the brands associated with a specific user. ```APIDOC ## GET /v1/users/{userId}/brands ### Description Get a user's brands. ### Method GET ### Endpoint /v1/users/{userId}/brands ### Parameters #### Path Parameters - **userId** (string) - Required - The ID of the user. ### Response #### Success Response (200) - **brands** (array of string) - The brands for the user. ``` -------------------------------- ### Valid Offsets for User Advertisements Source: https://api.marktplaats.nl/docs/v1/user-advertisements.html Examples of valid offset and limit combinations for paginating user advertisements. Ensure the offset is a multiple of the limit for correct pagination. ```text offset 0, limit 10 offset 10, limit 10 offset 100, limit 10 offset 12, limit 6 ``` -------------------------------- ### Get Current User Source: https://api.marktplaats.nl/docs/v1/_sources/me.rst.txt Retrieves the user that represents the logged-in user. ```APIDOC ## GET /v1/me ### Description Redirects you to the user that represents the logged in user. ### Method GET ### Endpoint /v1/me ### Response #### Success Response (200) - **user** (object) - The user object representing the logged-in user. ``` -------------------------------- ### Create New Advertisement Source: https://api.marktplaats.nl/docs/v1/advertisements.html Use this POST request to create a new advertisement. Include a Content-Type header of application/json and provide advertisement details in the request body. Ensure the Host header is set to api.marktplaats.nl. ```http POST /v1/advertisements/ HTTP/1.1 Host: api.marktplaats.nl Content-Type: application/json ``` ```json { "description": "Brand new bike", "title": "test advertisement", "categoryId": 2, "location": { "postcode": "1097DN" }, "priceModel" : { "modelType" : "fixed", "askingPrice" : 1550 } } ``` -------------------------------- ### Get Advertisement Transaction by ID Source: https://api.marktplaats.nl/docs/v1/endpoints.html Retrieves details of a specific transaction for an advertisement. ```APIDOC ## GET /v1/advertisements/{itemId}/transactions/{transactionId} ### Description Retrieves details of a specific transaction for an advertisement. ### Method GET ### Endpoint /v1/advertisements/{itemId}/transactions/{transactionId} ### Parameters #### Path Parameters - **itemId** (string) - Required - The unique identifier of the advertisement. - **transactionId** (string) - Required - The unique identifier of the transaction. ``` -------------------------------- ### Create New Advertisement Source: https://api.marktplaats.nl/docs/v1/_sources/advertisements.rst.txt Creates a new advertisement by posting to the advertisements collection. Refer to the advertisement resource documentation for required fields and potential errors. ```http POST /v1/advertisements ``` -------------------------------- ### Obtaining an Access Token for a client Source: https://api.marktplaats.nl/docs/v1/index.html Steps to obtain an access token for a client application (client credentials flow). ```APIDOC ## Obtaining an Access Token for a client Use this flow to get an access token for your client application. ### Step 1: POST to the token endpoint Make a POST request to the token endpoint with your client credentials. ### Step 2: Receive token response Receive the access token and other details in the response. ```