Geolocation Matching
1. Introduction
Welcome to the Location Matching API documentation! This API is designed to help you compare two locations, whether they are provided as addresses or coordinates (latitude and longitude). It's a handy tool for various applications where you need to determine the proximity between two places.
2. How to Use
To use the API, you simply need to make a POST request to the provided endpoint with the necessary parameters. These parameters include:
- reference_id: A unique identifier for your request.
- consent: Whether the user has consented to the location matching process.
- purpose: A brief description of why you're performing the location matching.
- location1: The first location to compare, which can be either an address or coordinates.
- location2: The second location to compare, also provided as an address or coordinates.
- match_threshold: The maximum allowed distance between the two locations for a match to be considered successful.
3. Understanding the Response
After making a request, you'll receive a response indicating whether the locations match and additional information such as the distance between them. Here's what you can expect in the response:
- decentroTxnId: A unique transaction identifier for your request.
- status: Whether the API call was successful or not.
- responseCode: A code indicating the result of the API call.
- message: A human-readable message explaining the result.
- data: Contains detailed information about the location match, including distance and match status.
- responseKey: Indicates the type of response received.
4. Sample Request and Response
To better understand how the API works, here's a sample request and the corresponding response:
Request:
{
"reference_id": "7e789d22-6dc6-4bd3-99a0-27a7d8f97c0c",
"consent": true,
"purpose": "Match the address of customer",
"location1": {
"address": "CRED Indiranagar"
},
"location2": {
"coordinates": {
"longitude": 77.6413954,
"latitude": 12.9638841
}
},
"match_threshold": 600
}
Response:
{
"decentroTxnId": "8132DB52D43249C6B011BD5F288D7B5A",
"status": "SUCCESS",
"responseCode": "S00000",
"message": "Successfully performed location matching",
"data": {
"distance": 0,
"matchStatus": true,
"coordinates1": {
"longitude": 77.6413954,
"latitude": 12.9638841
},
"coordinates2": {
"longitude": 77.6413954,
"latitude": 12.9638841
}
},
"responseKey": "success_location_match_completed"
}
5. Conclusion
The Location Matching API is a powerful tool for comparing locations in your applications. Whether you're building a delivery service, a mapping application, or anything in between, this API can help you determine the proximity between two places with ease. If you have any questions or need further assistance, feel free to reach out to our team.
We hope this documentation helps you integrate the Location Matching API seamlessly into your projects!
Updated 9 months ago