Publish
This endpoint can be used to publish an advertisement to the specified portal
The call will only succeed when enough credits are available in the user's account (when applicable)
A positive result returned by this endpoint will indicate the creation of an item in the processing-queue. It does not mean the item has been or will be successfully processed at the specified portal. See the status-endpoint to receive additional information.
When an item is already published to the specified portal, a POST call will result in the ad beïng updated with the latest available data and media.
Using a PUT call will only result in the ad beïng updated when the item has been published to the specified portal.
Reference
POST /publish/
Publish a single advertisement to the specified portal
POST /publish/batch
Publish multiple advertisements to the specified portal
PUT /publish/
Update a single advertisement on the specified portal
PUT /publish/batch
Update multiple advertisements on the specified portal
PUT /publish/batchauto
Update all active advertisements on the specified portal without the need to specify the individual adId's
DELETE /publish/
Remove the advertisement from the specified portal or remove the queue-item to publish this item when not yet processed.
DELETE /publish/batch
Remove multiple advertisements from the specified portal or remove the queue-item to publish the items when not yet processed.
Fields
field | type | description/constraints | Req | W | U |
---|---|---|---|---|---|
userId | int | The userId | Yes | Yes | No |
adId | int / array | The adId or a list of adids when using the 'batch'-endpoint. | Yes | Yes | No |
When using endpoint PUT /publish/batchauto this field is not mandatory and will be ignored. |
|||||
portal | string | Available options: | Yes | Yes | No |
- marktplaats | |||||
- tweedehands | |||||
- website | |||||
images | boolean | Also submit images when publishing or just the advertisement data | No | No | No |
default: true |
Example publishing advertisement to portal
Request
POST /rest/v1/publish/ HTTP/2
{
"userId": 12311,
"adId": 659593,
"portal": "marktplaats",
"images": true
}
Response
{
"result": true,
"errors": [],
"data": []
}
or
{
"result": false,
"errors": [
"portal: marktplaats - adId: 659593 - insufficient means"
],
"data": []
}
Example removing advertisement from portal
Request
DELETE /rest/v1/publish/ HTTP/2
{
"userId": 12311,
"adId": 659593,
"portal": "marktplaats"
}
Response
{
"result": true,
"errors": [],
"data": []
}