{"_id":"58aad9de8f862f250076fa26","category":{"_id":"58aad9dd8f862f250076f9f6","version":"58aad9dd8f862f250076f9f4","project":"54aa7f773b56130b0056c86e","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-11-17T23:47:10.058Z","from_sync":false,"order":2,"slug":"pulsate-cms-api","title":"Pulsate CMS API"},"user":"54aa7f3f9bb00c0b00cb899b","__v":0,"project":"54aa7f773b56130b0056c86e","version":{"_id":"58aad9dd8f862f250076f9f4","project":"54aa7f773b56130b0056c86e","__v":2,"createdAt":"2017-02-20T11:58:21.765Z","releaseDate":"2017-02-20T11:58:21.765Z","categories":["58aad9dd8f862f250076f9f5","58aad9dd8f862f250076f9f6","58aad9dd8f862f250076f9f7","58aad9dd8f862f250076f9f8","58aad9dd8f862f250076f9f9","58aad9dd8f862f250076f9fa","58aad9dd8f862f250076f9fb","58ac26b3d460ce2500185d26"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"Locate","version_clean":"6.0.0","version":"6.0"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-18T08:44:43.478Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"guid\": \"3ixWCPxf\",\n  \"name\": \"sample_geofence_name\",\n  \"path\": [\n    [\n      50.042754135466986,\n      20.207290649414062\n    ],\n    [\n      50.02334733167384,\n      20.200166702270508\n    ],\n    [\n      50.02433991532921,\n      20.235872268676758\n    ],\n    [\n      50.03988771499381,\n      20.235872268676758\n    ]\n  ],\n  \"radius\": 101,\n  \"shape\": \"polygon\",\n  \"type\": \"enter\",\n  \"location\": [\n    50.042754135466986,\n    20.207290649414062\n  ],\n  \"id\": \"58762461636f6e3a0c7d0300\"\n}","name":""}]},"settings":"564bbbf80cbcc91700b8171c","examples":{"codes":[{"language":"shell","code":"curl -X POST \"https://control.pulsatehq.com/api/v1/apps/$APP_ID/geofences/\" \\\n-H \"Authorization: Token token=$MY_ADMIN_API_TOKEN\" \\\n-d '{\n    \"geofence\": {\n        \"name\": \"sample_geofence_name\",\n        \"location\": [50.042754135466986, 20.207290649414062],\n        \"type\": \"enter\",\n        \"shape\": \"polygon\",\n        \"radius\": \"101\",\n        \"path\": [\n            [50.042754135466986, 20.207290649414062],\n            [50.02334733167384, 20.200166702270508],\n            [50.02433991532921, 20.235872268676758],\n            [50.03988771499381, 20.235872268676758]\n        ]\n    }\n}'","name":""}]},"method":"post","auth":"required","params":[{"_id":"564c387b9baa330d00faa623","ref":"","in":"body","required":true,"desc":"Geofence to be inserted","default":"{}","type":"object","name":"geofence"},{"_id":"57ff8232e7218a1900673d08","ref":"","in":"path","required":true,"desc":"","default":"","type":"string","name":"app_id"},{"_id":"58764a1a36358c0f004bde40","ref":"","in":"body","required":false,"desc":"Name of geofence","default":"","type":"string","name":"geofence.name"},{"_id":"58764a1a36358c0f004bde3f","ref":"","in":"body","required":false,"desc":"Location of the geofence as [latitude, longitude]","default":"","type":"array_float","name":"geofence.location"},{"_id":"58764a1a36358c0f004bde3e","ref":"","in":"body","required":false,"desc":"Type of the geofence, can be one of: [\"enter\", \"exit\"]","default":"","type":"string","name":"geofence.type"},{"_id":"58764a1a36358c0f004bde3d","ref":"","in":"body","required":false,"desc":"Type of geofence, can be one of [\"circle\", \"polygon\"]","default":"","type":"string","name":"geofence.shape"},{"_id":"58764a1a36358c0f004bde3c","ref":"","in":"body","required":false,"desc":"Radius of the circle geofence in meters","default":"","type":"string","name":"geofence.radius"},{"_id":"58764a1a36358c0f004bde3b","ref":"","in":"body","required":false,"desc":"Path of the polygon geofence, as array of [latitude, longitude]","default":"","type":"array_float","name":"geofence.path"}],"url":"/apps/:app_id/geofences"},"isReference":true,"order":16,"body":"","excerpt":"","slug":"geofences-create-one","type":"endpoint","title":"Geofences: Create One"}

postGeofences: Create One


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

app_id:
required
string

Body Params

geofence:
required
object{}
Geofence to be inserted
geofence.name:
string
Name of geofence
geofence.location:
array_float
Location of the geofence as [latitude, longitude]
geofence.type:
string
Type of the geofence, can be one of: ["enter", "exit"]
geofence.shape:
string
Type of geofence, can be one of ["circle", "polygon"]
geofence.radius:
string
Radius of the circle geofence in meters
geofence.path:
array_float
Path of the polygon geofence, as array of [latitude, longitude]

Examples


Result Format


User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}