Images
This endpoint can be used to add to and remove images from the specified advertisement
Reference
GET /images/<adId>
Retrieve the list of images of the specified advertisement
POST /images/<adId>
Replace all images of the specified advertisement with the supplied imagelist.
PUT /images/<adId>
Add images to the imagecollection of an advertisement
DELETE /images/<adId>
Remove all or a selection of images of the specified advertisement
POST /imageswitch/
Switch the position of the two supplied images.
POST /imageshift/
Shift an image to another position.
Fields
field | type | description/constraints | Req | W | U |
---|---|---|---|---|---|
adId | int | Yes | No | No | |
images | array | List of image-objects | Yes | Yes | Yes |
autoupdate | boolean | Default: true Automatically push all updated images to available portals when ad is published |
No | Yes | Yes |
Fields image
field | type | description/constraints | Req | W | U |
---|---|---|---|---|---|
counter | int | No | No | No | |
image | object | List of imageDetails-objects | Yes | Yes | Yes |
thumbnail | object | List of imageDetails-objects | No | No | No |
Fields imageDetails
field | type | description/constraints | Req | W | U |
---|---|---|---|---|---|
url | string | The URL of the image Either url or path is mandatory |
Yes/No | Yes | Yes |
path | string | The location of the image on the servers filesystem Either url or path is mandatory |
Yes/No | Yes | Yes |
Example retrieving images
Request
GET /rest/v1/images/3142675/ HTTP/2
Response
{
"result": true,
"errors": [],
"data": {
"adId": 3142675,
"images": [
{
"counter": 1,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/1/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/1/?w=100&h=100&ps=1"
}
},
{
"counter": 2,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/2/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/2/?w=100&h=100&ps=1"
}
},
{
"counter": 3,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/3/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/3/?w=100&h=100&ps=1"
}
},
{
"counter": 4,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/4/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/4/?w=100&h=100&ps=1"
}
},
{
"counter": 5,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/5/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/5/?w=100&h=100&ps=1"
}
},
{
"counter": 6,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/6/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/6/?w=100&h=100&ps=1"
}
},
{
"counter": 7,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/7/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/7/?w=100&h=100&ps=1"
}
},
{
"counter": 8,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/8/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/8/?w=100&h=100&ps=1"
}
},
{
"counter": 9,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/9/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/9/?w=100&h=100&ps=1"
}
},
{
"counter": 10,
"image": {
"url": "https://img.goedgeplaatst.nl/3142675/10/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142675/10/?w=100&h=100&ps=1"
}
}
]
}
}
Example adding/replacing images
Request
POST /rest/v1/images/ HTTP/2
{
"adId": 659593,
"images": [
{
"counter": 1,
"image": {
"url": "https://webshop-domain.nl/images/1000-1.jpg"
}
},
{
"counter": 2,
"image": {
"url": "https://webshop-domain.nl/images/1000-2.jpg"
}
}
]
}
Reponse
{
"result": true,
"errors": [],
"data": {
"adId": 1022705,
"images": [
{
"counter": 1,
"image": {
"url": "https://webshop-domain.nl/images/1000-1.jpg"
}
},
{
"counter": 2,
"image": {
"url": "https://webshop-domain.nl/images/1000-2.jpg"
}
}
]
}
}
Example removing all images
Request
DELETE /rest/v1/images/1022705 HTTP/2
Response
{
"result": true,
"errors": [],
"data": false
}
Example removing a selection of images
Request
DELETE /rest/v1/images/ HTTP/2
{
"adId": 3142641,
"images": [
2
]
}
Response
{
"result": true,
"errors": [],
"data": {
"adId": 3142641,
"images": [
{
"counter": 1,
"image": {
"url": "https://webshop-domain.nl/images/1000-1.jpg"
}
}
]
}
}
Example switching two images
Request
POST /rest/v1/imageswitch/ HTTP/2
{
"adId": 3142641,
"images": [
1,
2
]
}
Response
{
"result": true,
"errors": [],
"data": [
{
"counter": 1,
"image": {
"url": "https://img.goedgeplaatst.nl/3142641/1/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142641/1/?w=100&h=100&ps=1"
}
},
{
"counter": 2,
"image": {
"url": "https://img.goedgeplaatst.nl/3142641/2/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142641/2/?w=100&h=100&ps=1"
}
},
{
"counter": 3,
"image": {
"url": "https://img.goedgeplaatst.nl/3142641/3/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142641/3/?w=100&h=100&ps=1"
}
}
]
}
Example shifting an image
Request
POST /rest/v1/imageshift/ HTTP/2
{
"adId": 3142641,
"images": [
1,
6
]
}
Response
{
"result": true,
"errors": [],
"data": [
{
"counter": 1,
"image": {
"url": "https://img.goedgeplaatst.nl/3142641/1/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142641/1/?w=100&h=100&ps=1"
}
},
{
"counter": 2,
"image": {
"url": "https://img.goedgeplaatst.nl/3142641/2/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142641/2/?w=100&h=100&ps=1"
}
},
{
"counter": 3,
"image": {
"url": "https://img.goedgeplaatst.nl/3142641/3/"
},
"thumbnail": {
"url": "https://img.goedgeplaatst.nl/3142641/3/?w=100&h=100&ps=1"
}
}
]
}