1Fetch Client API

<back to all web services

CalculateDistance

The following routes are available for this service:
POST/calculatedistanceCalculate the distance between a list of coordinates
CalculateDistance Parameters:
NameParameterData TypeRequiredDescription
CoordinatesbodyList<Coordinate>YesArray of coordinates
ApiServiceRequest Parameters:
NameParameterData TypeRequiredDescription
ApiKeyformstringYesThe API Key required for authentication
Coordinate Parameters:
NameParameterData TypeRequiredDescription
LatitudeformdoubleYesThe Latitude
LongitudeformdoubleYesThe Longitude
CalculateDistanceResponse Parameters:
NameParameterData TypeRequiredDescription
PointDistancesformList<decimal>NoA list of the distances between each point, returned in order that the points were provided
TotalDistanceformdecimalNoThe total distance between all points
ApiServiceResponse Parameters:
NameParameterData TypeRequiredDescription
DescriptionformstringYesInformation about the response.
HeadingformstringYesHeading or summary of the response.
WasSuccessfulformbooleanYesDid the intended operation for this response complete successfully?

To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /calculatedistance HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Coordinates":[{"Latitude":0,"Longitude":0}],"ApiKey":"String"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"PointDistances":[0],"TotalDistance":0,"Description":"String","Heading":"String","WasSuccessful":false}