Jednostki reklamowe

Jednostki reklamowe

🛡
To API jest zabezpieczone — w requestach w nagłówku Authorization należy przekazać token dostępowy.

Domyślną ścieżką zarządzania jednostkami reklamowymi jest panel AdsHero. Opisane tutaj API służy do dynamicznej rejestracji jednostek reklamowych i zazwyczaj nie musi być używane.

Za pomocą tego API nie można pobierać/modyfikować/usuwać jednostek reklamowych utworzonych za pomocą panelu AdsHero.

Tworzenie jednostek reklamowych

Zapytanie:

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"
    }
  }
}

Odpowiedź:

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"
         }
       }
     }'

Modyfikacja jednostek reklamowych

Zapytanie:

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"
    }
  }
}

Odpowiedź:

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"
         }
       }
     }'

Pobieranie jednostek reklamowych

Zapytanie:

GET https://api.adshero.io/v1/slots/technical/{publisherSlotId} HTTP/2
Authorization: Bearer {access_token}
Accept: application/json

Odpowiedź:

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'

Usuwanie jednostek reklamowych

Zapytanie:

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}'