Sections ▾

GET ​/api​/geofences

Gets the available geofences for an app. You can get geofences close to you by providing your current position and a radius to search for.

  
  curl -X GET "https://app.contexthub.com/api/geofences" \
       -H "Content-Type: application/json" \
       -H "CONTEXTHUB_DEVICE_ID: DB4E6157-D64F-43EE-B114-39A13D2B9BC7" \
       -H "Authorization: Token token=\"534e565f-335a-469d-974e-e18a85f00d2d\"" \
       -v \
  

Request

Example Request

{
  "latitude": 29.763638,
  "longitude": -95.461874,
  "radius": 2000,
  "limit": 20,
  "tag": "foo",
  "tag_operator": [
    "ALL",
    "ANY"
  ]
}

Example Parameters

Response

Example Response

[
  {
    "id": 42,
    "name": "home",
    "latitude": "-78.349137",
    "longitude": "124.435517",
    "radius": 1000,
    "tags": [
      "office"
    ],
    "tag_string": "tag1,tag2,tag3"
  }
]

Response Parameters

Response Codes

Successful Response Codes

Failure Response Codes