Performs a Find Your Nearest search based on a postcode.
Please note this is for the UK only at present.
URL: /fyn/v1/postcode
Method: POST
Method Parameters
Name |
Type |
Required |
Description |
apiKey |
string |
Yes |
The API key for your organisation. |
model |
object |
Yes |
The object detailing the specified values. See Model Object Properties. |
Model Object Properties
Name |
Type |
Required |
Description |
rulesetKey |
string |
Yes |
The API key of the Ruleset to be used. |
tagKeys |
string array |
No |
Optional. 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. |
postcode |
string |
Yes |
The postcode used for searching. |
Response
Code |
Error Message |
Notes |
200 |
|
The request was a success. Note: It is possible to get a result from an Allocation rule with an invalid postcode, providing that part of the postcode was matched against a territory. If further results were requested and the postcode was invalid, you will get a successful response. |
400 |
The API Key provided was either empty or null. |
The API Key was empty or null. White-space is ignored. |
400 |
No payload data was received. |
The request's model object was null. |
400 |
The Ruleset Key provided was either empty or null. |
The rulesetKey value was either empty or null. |
400 |
The Postcode provided was either empty or null. |
The postcode value was either empty or null. |
400 |
The Ruleset provided does not have any rules attached. |
A Ruleset matching the rulesetKey parameter value was found but no rules have been set up for it. |
404 |
No matching postcode could be found. |
No result was found using an Allocation rule and the supplied postcode could not be found. |
404 |
The Ruleset could not be found using the key provided. |
No Ruleset matching the rulesetKey parameter value could be found. |
Example call
URL: https://api.vision-mapping.com/fyn/v1/postcode?apiKey=INSERT_YOUR_KEY_HERE
Body:
{"rulesetKey":"abc","tagKeys":["abc","abc1","abc2"],"postcode":"abc"}
Example response
[{"name":"abc","uniqueKey":"abc","distanceInMiles":123,"dataFields":[{"key":"abc","value":"abc"}],"matchedTags":["abc","abc"]}]
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.
Comments
0 comments
Article is closed for comments.