{"_id":"59e70ba0e027ae002e7d2f3c","category":{"_id":"59e70b9ee027ae002e7d2ed7","version":"59e70b9ee027ae002e7d2ed2","project":"5496d393f52a630b00519cdd","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-01T08:45:54.712Z","from_sync":false,"order":4,"slug":"geofencing-triggers","title":"Geofencing Triggers"},"project":"5496d393f52a630b00519cdd","parentDoc":null,"user":"5496d353f52a630b00519cdc","version":{"_id":"59e70b9ee027ae002e7d2ed2","project":"5496d393f52a630b00519cdd","__v":2,"createdAt":"2017-10-18T08:06:54.462Z","releaseDate":"2017-10-18T08:06:54.462Z","categories":["59e70b9ee027ae002e7d2ed3","59e70b9ee027ae002e7d2ed4","59e70b9ee027ae002e7d2ed5","59e70b9ee027ae002e7d2ed6","59e70b9ee027ae002e7d2ed7","59e70b9ee027ae002e7d2ed8","59e70b9ee027ae002e7d2ed9","59e70b9ee027ae002e7d2eda","59e70b9ee027ae002e7d2edb","59e70b9ee027ae002e7d2edc","59e70b9ee027ae002e7d2edd","59e70b9ee027ae002e7d2ede","59e70b9ee027ae002e7d2edf","5b8661ccdd19310003a3fa0b"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"2.0.10","version":"2.0.10"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-06-01T09:14:27.984Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"method":"post","results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"callback_url\",\n    \"h-0\": \"Field\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Type\",\n    \"h-3\": \"Example\",\n    \"0-1\": \"Your server callback URL.\",\n    \"0-2\": \"String\",\n    \"0-3\": \"https://geofence.myapp.com\"\n  },\n  \"cols\": 4,\n  \"rows\": 1\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How to Authenticate Triggers Origin\"\n}\n[/block]\nEach trigger callback call has two additional parameters - \"Timestamp\" and a \"Signature\". For example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://your-callback-server.com/triggers?timestamp=1455119126&signature=0936e117debe91a0de827d8cf066bb90474f1d39\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n**Signature** combined with **Timestamp** may be used to validate the origin and the authenticity of the trigger. To better understand how Placer generates signatures using your App Secret, please see [Authentication](doc:server-2-server-rest-api).\n\nTo get you started quickly with validating signatures, please see a python example [here](https://storage.googleapis.com/public_drops/trigger_signature_validator.py).\n\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Note\",\n  \"body\": \"Triggers of apps with an average rate of 1 trigger per second, will be batched and sent every 30 seconds in a compressed gzip file format. Please contact your account manager for further information if needed.\"\n}\n[/block]\n##Request Retry logic\n  * Callback Server should return a status code 200. Any other code will result in a \"Retry\" after 3 seconds.\n  * The Callback server must respond within 300ms. Higher latency won't generate a retry.","excerpt":"HTTPS api.placer.io/v2/apps/**APP_KEY**/triggers/set_callback/\n\nSet your server callback URL. Relevant triggers will be sent to this URL.","slug":"triggersset_callback","type":"endpoint","title":"Triggers/set_callback/"}

postTriggers/set_callback/

HTTPS api.placer.io/v2/apps/**APP_KEY**/triggers/set_callback/ Set your server callback URL. Relevant triggers will be sent to this URL.

[block:parameters] { "data": { "0-0": "callback_url", "h-0": "Field", "h-1": "Description", "h-2": "Type", "h-3": "Example", "0-1": "Your server callback URL.", "0-2": "String", "0-3": "https://geofence.myapp.com" }, "cols": 4, "rows": 1 } [/block] [block:api-header] { "type": "basic", "title": "How to Authenticate Triggers Origin" } [/block] Each trigger callback call has two additional parameters - "Timestamp" and a "Signature". For example: [block:code] { "codes": [ { "code": "https://your-callback-server.com/triggers?timestamp=1455119126&signature=0936e117debe91a0de827d8cf066bb90474f1d39", "language": "http" } ] } [/block] **Signature** combined with **Timestamp** may be used to validate the origin and the authenticity of the trigger. To better understand how Placer generates signatures using your App Secret, please see [Authentication](doc:server-2-server-rest-api). To get you started quickly with validating signatures, please see a python example [here](https://storage.googleapis.com/public_drops/trigger_signature_validator.py). [block:callout] { "type": "warning", "title": "Note", "body": "Triggers of apps with an average rate of 1 trigger per second, will be batched and sent every 30 seconds in a compressed gzip file format. Please contact your account manager for further information if needed." } [/block] ##Request Retry logic * Callback Server should return a status code 200. Any other code will result in a "Retry" after 3 seconds. * The Callback server must respond within 300ms. Higher latency won't generate a retry.