Create Distance Targeting Geometry

Why Create Distance Targeting Geometry?

Occasionally, you may wish to create very specific targeting for a flight using a predetermined distance from a street address. For example, if you want to target a certain locale where ads will be served within a narrow area, you can pinpoint an exact distance for your targeting by creating a distance targeting geometry object using Latitude, Longitude, and StreetAddress body parameters. The Kevel API enables you to create this object, which can then be used in your geo-targeting.

API Syntax

When using the Create Distance Targeting Geometry 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}/distance

Where:

Parameters

Response Codes

200

{
  "Distance": 0,
  "StreetAddress": "",
  "FlightId": 0,
  "Latitude": 0,
  "Longitude": 0,
  "Id": 0
}

400

503

Using street address

curl -X POST -H "X-Adzerk-ApiKey:$ADZERK_API_KEY" -H "Content-Type:application/json" https://api.kevel.co/v1/flight/12345/distance --data-binary '{"Distance":42.0,"StreetAddress":"1 Kevel Boulevard, Keveltown NC 27701"}'

Using longitude and latitude

curl -X POST -H "X-Adzerk-ApiKey:$ADZERK_API_KEY" -H "Content-Type:application/json" https://api.kevel.co/v1/flight/12345/distance --data-binary '{"Distance":42.0,"Latitude":35.9950488,"Longitude":-78.9081815}'
{
  "Distance": 42,
  "StreetAddress": "1 Kevel Boulevard, Keveltown NC 27701",
  "FlightId": 12345,
  "Latitude": 35.9950488,
  "Longitude": -78.9081815,
  "Id": 123
}