Sections ▾

POST ​/api​/geofences

Create a new geofence

  
    curl -X POST "https://app.contexthub.com/api/geofences" \
         -H "CONTEXTHUB_DEVICE_ID: DB4E6157-D64F-43EE-B114-39A13D2B9BC7" \
         -H "Content-Type: application/json" \
         -H "Authorization: Token token=\"534e565f-335a-469d-974e-e18a85f00d2d\"" \
         -d $'{\n  "geofence": {\n    "name": "Fence 1",\n    "latitude": 29.76344397288731,\n    "longitude": -95.46172896703202,\n    "radius": 265,\n    "tags": [\n      "foo"\n    ]\n  }\n}' \
         -m 30 \
         -v \
  

Request

Example Request

{
  "geofence": {
    "name": "MyString",
    "latitude": 1.5,
    "longitude": 1.5,
    "radius": 1000,
    "tags": [
      "foo"
    ]
  }
}

Example Parameters

Response

Example Response

{
  "id": 42,
  "name": "Home",
  "latitude": 29.763638,
  "longitude": -95.461874,
  "radius": 1000,
  "tags": [
    "office"
  ],
  "tag_string": "tag1,tag2,tag3"
}

Response Parameters

Response Codes

Successful Response Codes

Failure Response Codes