Get All Geolocations
The Get All Geolocations API accepts Start and pageSize as input parameters and returns an array of geolocations. The pageSize represents the maximum number of geolocations for which the details are to be returned. If Start is specified, the number of the geolocations that are returned are from start position to pageSize value. For example: if the Start value is zero and pageSize is five, then five geolocations from positions zero to four are returned. The Start default value is 0; the pageSize default is 20. To get all geolocations, set pageSize to the total number of geolocations.
Use Case
You can use this API if you want to develop a social networking application that allows you to see exactly where your friends are, so that you can decide if you want to visit them.
URL
The HTTP URL for Get All Geolocations API is:
http://<host>:<port>/api/v1/geolocations?start=0&pageSize=10
This is an authenticated API. It implements Gateway Filter for Authentication to authenticate access of the API by a user.
Method
GET
Output Parameters
The following fields are output parameters:
Sample Response
{ "total" : 2, "locations" : [ { "id" : 1, "name" : "New York", "description" : "New York City Shopping Area", "latitude" : 40.7324, "longitude" : -73.8248, "altitude" : "", "miles" : 50.0, "lastModifiedBy" : "admin", "createdBy" : "admin", "clientAction": "localNotification", "message": "Sample local notification message", "lastModifiedDateStr" : "06/21/2016 05:59:06 PM IST", "createdDateStr" : "06/21/2016 05:21:49 PM IST" "locationTags": [ "Tag1", "Tag2", "Tag3" ], "metadata": [ { "key": "key1", "value": "value1" } ] }, { "id" : 2, "name" : "Santa Maria", "description" : "Santa Maria, Colombia (north)", "latitude" : 10.7324, "longitude" : -73.8248, "altitude" : 80.0, "miles" : 50.0, "lastModifiedBy" : "admin", "createdBy" : "admin", "clientAction": "localNotification", "message": "Sample local notification message", "lastModifiedDateStr" : "06/21/2016 05:56:38 PM IST", "createdDateStr" : "06/21/2016 05:56:38 PM IST" "locationTags": [ "Tag1", "Tag2", "Tag3" ], "metadata": [ { "key": "key1", "value": "value1" } ] } ] }
Response Status
Code | Description |
---|---|
Status 200 | Array of geolocations |
Status 400 | Bad request |
Status 401 | Unauthorized request |
Status 500 | Server failure to process request |