Slots
Authorization header.The default method of managing ad units is through the Adshero panel. The API described here is used for the dynamic registration of ad units and usually does not need to be used.
This API cannot be used to retrieve individually, modify or delete ad units created through the Adshero panel. They are only visible in the shop ad unit list.
Listing Shop Ad Units
Returns a page of not deleted ad units of the shop sorted by name, including those created in the Adshero panel. Required query parameters: page (numbered from 1) and pageSize (from 1 to 100). meta describes the returned page. businessSlot is the placement of the ad unit, and adFormatIds are identifiers of ad formats assigned to the ad unit. publisherSlotId and metadata are present only for ad units created through the API.
The example below shows an ad unit created through the API followed by one created in the Adshero panel.
Request:
GET https://api.adshero.io/v1/slots/technical/shop/{shopId}?page=1&pageSize=10 HTTP/2
Authorization: Bearer {access_token}
Accept: application/jsonResponse:
HTTP/2 200 OK
Content-Type: application/json
{
"data": [
{
"id": "1e4b7c2a-6d3f-4b8e-9a1c-2f5d8e7b4a60",
"publisherSlotId": "category-sidebar",
"name": "Category sidebar",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"status": "ACTIVE",
"businessSlot": {
"id": "7f3e9b1d-2c4a-4e6f-8b0d-1a2c3e4f5a6b",
"name": "Category"
},
"adFormatIds": ["5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f"],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
},
"hash": "3a9d6f2e-8b1c-4d7a-9e5f-0c2b4a6d8e1f",
"country": "PL"
},
{
"id": "4b0e2a5c-0d7e-4a39-9a0b-6f4e1d2c3b4a",
"name": "Homepage top banner",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"status": "ACTIVE",
"businessSlot": {
"id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
"name": "Homepage"
},
"adFormatIds": ["5d6e7f80-9a1b-4c2d-8e3f-4a5b6c7d8e9f"],
"hash": "8f1c2d3e-4a5b-4c6d-8e7f-9a0b1c2d3e4f",
"country": "PL"
}
],
"meta": {
"page": 1,
"itemsPerPage": 10,
"totalResults": 2,
"hasNext": false,
"hasPrevious": false
}
}curl --request GET 'https://api.adshero.io/v1/slots/technical/shop/{shopId}?page=1&pageSize=10' \
--header 'Authorization: Bearer {access_token}' \
--header 'Accept: application/json'Creating Ad Units
Request:
PUT https://api.adshero.io/v1/slots/technical/{publisherSlotId} HTTP/2
Authorization: Bearer {access_token}
Content-Type: application/json
{
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}Response:
HTTP/2 201 OK
Content-Type: application/json
{
"id": "",
"publisherSlotId": "",
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"status": "",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}curl --request PUT 'https://api.adshero.io/v1/slots/technical/{publisherSlotId}' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data '{
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}'Modifying Ad Units
Request:
PUT https://api.adshero.io/v1/slots/technical/{publisherSlotId} HTTP/2
Authorization: Bearer {access_token}
Content-Type: application/json
{
"id": "",
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}Response:
HTTP/2 201 OK
Content-Type: application/json
{
"id": "",
"publisherSlotId": "",
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"status": "",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}curl --request PUT 'https://api.adshero.io/v1/slots/technical/{publisherSlotId}' \
--header 'Authorization: Bearer {access_token}' \
--header 'Content-Type: application/json' \
--data '{
"id": "",
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}'Retrieving Ad Units
Request:
GET https://api.adshero.io/v1/slots/technical/{publisherSlotId} HTTP/2
Authorization: Bearer {access_token}
Accept: application/jsonResponse:
HTTP/2 200 OK
Content-Type: application/json
{
"id": "",
"publisherSlotId": "",
"name": "",
"shopId": "cf196098-c935-4ac4-83f2-aece5185602a",
"status": "",
"businessSlot": {
"id": ""
},
"adFormatIds": [],
"metadata": {
"location": {
"country": "Poland",
"street": "Bruszewska 28",
"city": "Warsaw",
"postalCode": "03-046"
}
}
}curl --request GET 'https://api.adshero.io/v1/slots/technical/{publisherSlotId}' \
--header 'Authorization: Bearer {access_token}' \
--header 'Accept: application/json'Deleting Ad Units
Request:
DELETE https://api.adshero.io/v1/slots/technical/{publisherSlotId} HTTP/2
Authorization: Bearer {access_token}curl --request DELETE 'https://api.adshero.io/v1/slots/technical/{publisherSlotId}' \
--header 'Authorization: Bearer {access_token}'