Update Distance Targeting Geometry
Why Update Distance Targeting Geometry?
When you are working with distance targeting, you may occasionally wish to update the distance targeting geometry object to improve targeting for a flight. The Kevel API enables you to update the geometry object by using the Update Distance Targeting Geometry endpoint and making changes by making a PUT request to the endpoint and including the changes you would like to make to the geometry object.
This API call will then update the Distance targeting geometry object associated with the flight specified.
API Syntax
When using the Update 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:
PUT https://api.kevel.co/v1/flight/FlightID/distance/GeometryID`
Where:
PUT- 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.distance- the distance targeting geometry object that contains theDistance,Latitude,Longitude, andStreetAddressbody parameters used for distance targeting.GeometryID- The ID of the Distance Targeting geometry
📘
Clearing attribute values
To unset or clear an attribute, set its value to
NULL.
Parameters
FlightID
int32
required
The ID of the flightGeometryID
int32
required
The ID of the Distance Targeting geometryDistance
float
The radius of the Distance geometry in kilometers. Min: 0.01, Max: 500 Optional on networks with user-specified radius features enabled; omit for user-specified radius.Latitude
float
The latitude of the Distance point. Saved up to 7 decimal places. Cannot be used withStreetAddress.Longitude
float
The longitude of the Distance point. Saved up to 7 decimal places. Cannot be used withStreetAddress.StreetAddress
string
The street address of the Distance point. This will be resolved to latitude and longitude. Cannot be used withLatitudeandLongitudeparams.
Responses
200
- Distance: integer
- StreetAddress: string
- FlightId: integer
- Latitude: number
- Longitude: number
- Id: integer
400
503
Examples
Using street address
curl -X PUT -H "X-Adzerk-ApiKey:60cdebece24d45b4f6359c66f835bampa" -H "Content-Type:application/json" https://api.kevel.co/v1/flight/12345/distance/123 --data-binary '{"Distance":42.0,"StreetAddress":"1 Adzerk Boulevard, Adzerktown NC 27701"}'
Using longitude and latitude
curl -X PUT -H "X-Adzerk-ApiKey:60cdebece24d45b4f6359c66f835bampa" -H "Content-Type:application/json" https://api.kevel.co/v1/flight/12345/distance/123 --data-binary '{"Distance":42.0,"Latitude":35.9950488,"Longitude":-78.9081815}'
Sample JSON Response
{
"Distance": 42,
"StreetAddress": "1 Kevel Boulevard, Keveltown NC 27701",
"FlightId": 12345,
"Latitude": 35.9950488,
"Longitude": -78.9081815,
"Id": 123
}