Create Geolocation
The Create Geolocation API adds a geolocation.
Use Case
The Create Geolocation API defines a high-level interface to a location information such as latitude and longitude. Based on your requirement, you can create required geolocations. The created geolocations can be used in following scenarios:
Applications like Facebook can gather location-based data and show advertisements appropriate for that geographic region. Search engines like Google have also included location-based search results for their users.
Apps related with public transport data create maps that help people to make better decisions while commuting in a city.
URL
The HTTP URL for Create Geolocation API is:
http://<host>:<port>/api/v1/geolocations
This API implements Gateway Filter for Authentication to authenticate access of the API by a user.
Method
POST
Header
The payload's request header includes Content-Type as application/json
Input Parameters
The following fields are input parameters:
Sample Request
{
"name":"Lexington Ave",
"description":"Best Luxury Hotels in New York City",
"latitude":15.22,
"longitude":15.22,
"altitude":20.1,
"miles":1.1
"clientAction":"customLogic/localNotification/notifyEngagementServer",
"customLogic": "sdasd",
"locationTags": ["tag1", "tag2", "tag3"],
"metadata": [{
"key": "metaData1",
"value": "metaValue1"
}, {
"key": "metaData2",
"value": "metaValue2"
}]
}
Output Parameters
The following fields are output parameters:
| Output Parameter | Type | Description |
|---|---|---|
| message | string | Response status code |
| id | long | ID of the geolocation that was created. |
Sample Response
{
"message" : "Details added successfully",
"id" : "1"
)
Response Status
| Code | Description |
|---|---|
| Status 200 | Details added successfully |
| Status 400 | Name is required Latitude is required, Longitude is required, Location Miles is required |
| Status 401 | Unauthorized request |
| Status 500 | Server failure to process request |