Slots
🛡
This API is secured — you need to pass access token in the
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/modify/delete ad units created through the AdsHero panel.
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}'