Coordinates
Performs a Find Your Nearest search based on a coordinate.
URL: /fyn/v1/coordinates
Method: POST
Method Parameters
Name |
Type |
Required |
Description |
|
|
|
|
|
|
|
See Model Object Properties. |
Model Object Properties
Name |
Type |
Required |
Description |
|
|
|
|
|
|
|
A collection of Tag API key values to use for filtering results. This works as an "Any" rule, not an "All" rule, but note that results are prioritised based on the number of tags matched. |
|
|
|
The coordinates in which search from. |
Coordinate Object Properties
Name |
Type |
Required |
Description |
|
|
|
|
|
|
|
|
Response
Code |
Error Message |
Notes |
|
|
|
|
|
|
400 |
|
|
400 |
|
|
400 |
|
|
400 |
|
|
400 |
|
|
400 |
|
|
404 |
|
|
Example call
URL: https://api.vision-mapping.com/fyn/v1/coordinates?apiKey=INSERT_YOUR_KEY_HERE
Body:
{
rulesetKey: "abc",
tagKeys: [
"abc",
"abc1",
"abc2"
],
coordinates: {
longitudeX: 123,
latitudeY: 123
}
}
Example response
[
{
name: "abc",
uniqueKey: "abc",
distanceInMiles: 123,
dataFields: [
{
key: "abc",
value: string | number | boolean | object
}
],
matchedTags: [
"abc",
"abc"
]
}
]
If receiving an object, the structure is as follows:
{
lines: [""],
city: "",
county: "",
postcode: "",
country: ""
}
Result Order
When more than one result is requested, the default order of results is by distance (nearest first, farthest last).
When tagKeys are provided, the order is changed to:
- The number of tags matched
- The distance
Note: This means that if three tagKeys were provided, any results matching all three would be placed first, ordered within themselves by distance, then any results matching two keys ordered by distance and so on. The first result, therefore, is not the closest, but the closest which matches the most tags.