Create Site/Zone Targeting
Why Create Site/Zone Targeting?
When you are working with a flight, you may find it beneficial to target the flight to a specific site or zone so you can optimize the performance of the flight. The Create Site/Zone Targeting API endpoint enables you to map a flight to a site and/or zone placement.
For more information on zones and sites, please refer to the Zone and Site technical documentation.
API Syntax
When using the Create Site/Zone Targeting API endpoint, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:
POST https://api.kevel.co//v1/flight/{FlightID}/sitezonetargeting
Where:
POST- the type of API request being made.https://api.kevel.co- the URL for the request.v1- the API version.flight- the API endpoint being called.FlightID- the ID associated with the flight.sitezonetargeting- The site/zone you want to use for flight targeting.
Parameters
| Parameter | Type | Description |
|---|---|---|
| FlightID | int32 | ID of the Flight |
| SiteId | int32 | ID of the Site |
| ZoneId | int32 | ID of the Zone |
| IsExclude | boolean | Defaults to false. Whether targeting is to be excluded or included. Defaults to false, so if you leave this blank it'll target the site/zone. |
Response
200object
| Field | Type | Description |
|---|---|---|
| Id | integer | Defaults to 0 |
| FlightId | integer | Defaults to 0 |
| SiteId | integer | Defaults to 0 |
| ZoneId | integer | Defaults to 0 |
| IsExclude | boolean | Defaults to false |
Example
curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H "Content-Type:application/json" "https://api.kevel.co/v1/flight/12345/sitezonetargeting" --data-binary '{"FlightId":12345,"SiteId":678,"ZoneId":910,"IsExclude":false}'
{
"Id": 98765,
"FlightId": 12345,
"SiteId": 678,
"ZoneId": 910,
"IsExclude": false
}