{"_id":"56391a7e1593e4190073a3e6","editedParams":true,"editedParams2":true,"project":"55357364e02d480d0003c6d3","version":{"_id":"553591cd63cc650d00312925","project":"55357364e02d480d0003c6d3","__v":13,"forked_from":"55357365e02d480d0003c6d6","createdAt":"2015-04-20T23:54:53.134Z","releaseDate":"2015-04-20T23:54:53.134Z","categories":["553591cd63cc650d00312926","553591cd63cc650d00312927","5536e4d39f7f2d0d00b1cd54","5536e55c20d5ca0d0001580a","5536e6bf7fe60f0d000fd1c0","5536f5bba171250d00c00556","553a974369c2630d00a8562e","553a97c60074c80d00621c2a","553a98332af5f20d000fc32a","553a9b9869c2630d00a85642","556e0f23d02e0b190042f13d","563249b1dcc27a1700823650","5639113f049e420d00476b03","59a5dd94aaa11d003334edb4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"category":{"_id":"5639113f049e420d00476b03","project":"55357364e02d480d0003c6d3","__v":5,"version":"553591cd63cc650d00312925","pages":["563917851593e4190073a3dc","56391a7e1593e4190073a3e6","56391e7c2fc5520d001a4d6e","56391f722fc5520d001a4d70","563924a968b11f0d0048c9c0"],"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-03T19:55:43.923Z","from_sync":false,"order":10,"slug":"webhooks","title":"Webhooks"},"user":"55359b006dfbb90d003462b5","__v":1,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-03T20:35:10.046Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"post","results":{"codes":[{"code":"{\n  \"id\": \"f532d7e5-6861-488a-bdee-a4df0173899e\",\n  \"url\": \"http://api.goformz.com/v2/webhooks/f532d7e5-6861-488a-bdee-a4df0173899e\"\n}","name":"","status":201,"language":"json"}]},"settings":"","examples":{"codes":[{"language":"json","code":"{\n  \"eventType\": \"form.complete\",\n  \"targetUrl\": \"http://my.webhooks.com/formComplete\",\n  \"entityId\": \"c2759dfe-ecff-49d2-b79f-71314193bf85\"\n}","name":""}]},"auth":"required","params":[{"_id":"56391b13ec0f5d0d0085e7cf","ref":"","in":"body","required":true,"desc":"Object containing event type, target url and the entity id being watched","default":"","type":"object","name":"body"}],"url":"/webhooks"},"isReference":false,"order":2,"body":"The `entityId` in the context of the `form.complete` event is the template id.\n\nThe `Content-Type` header in the HTTP request headers should be set to `application/json`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Content-Type: application/json;\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\nIf successful, the server will respond with a HTTP Status Code of 201 (Created).\n\n</br><a href=\"https://api.goformz.com/docs/api/explorer/index#!/Webhooks/Webhooks_Post\" target=\"_blank\"><img src=\"https://files.readme.io/9Z82WIZnS7mZmco8oi4u_TryItNow3.png\" style=\"margin-left:15px\" width=\"128\" height=\"42\" ></a>\n\n<br />**Example of a JSON object sent to the `targetUrl` (via a POST):** \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"EventType\\\": \\\"form.complete\\\",\\n  \\\"EntityId\\\": \\\"40494170-db11-4868-8b58-a53d0164e724\\\",\\n  \\\"Timestamp\\\": \\\"635821261908979453\\\",\\n  \\\"Item\\\": {\\n    \\\"Id\\\": \\\"ea0bc768-4c30-4bec-bff5-a545005e2f2d\\\",\\n    \\\"Url\\\": \\\"https://api.goformz.com/v2/formz/ea0bc768-4c30-4bec-bff5-a545005e2f2d\\\"\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"create-a-webhook","type":"endpoint","title":"Create a Webhook"}

postCreate a Webhook


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

body:
required
object
Object containing event type, target url and the entity id being watched

Examples


Result Format


Documentation

The `entityId` in the context of the `form.complete` event is the template id. The `Content-Type` header in the HTTP request headers should be set to `application/json`. [block:code] { "codes": [ { "code": "Content-Type: application/json;", "language": "http" } ] } [/block] If successful, the server will respond with a HTTP Status Code of 201 (Created). </br><a href="https://api.goformz.com/docs/api/explorer/index#!/Webhooks/Webhooks_Post" target="_blank"><img src="https://files.readme.io/9Z82WIZnS7mZmco8oi4u_TryItNow3.png" style="margin-left:15px" width="128" height="42" ></a> <br />**Example of a JSON object sent to the `targetUrl` (via a POST):** [block:code] { "codes": [ { "code": "{\n \"EventType\": \"form.complete\",\n \"EntityId\": \"40494170-db11-4868-8b58-a53d0164e724\",\n \"Timestamp\": \"635821261908979453\",\n \"Item\": {\n \"Id\": \"ea0bc768-4c30-4bec-bff5-a545005e2f2d\",\n \"Url\": \"https://api.goformz.com/v2/formz/ea0bc768-4c30-4bec-bff5-a545005e2f2d\"\n }\n}", "language": "json" } ] } [/block]