EXECUTE Endpoint
3 min
you can execute a webhook, invoking the action that the webhook is configured to execute, with data given in the request the details of the method, request body, and headers to execute the execute webhook api are as shown base url https //{tenant url}/api/rest/webhooks/execute?extension={endpoint extension} note the endpoint extension is case sensitive \<font color="#ffffff">method\</font> post header name authorization rest api key \<font color="#ffffff">request body\</font> key value value format value body text (json or xml) the body of the request, for example, the data to be provided to the configured action note the body parameter in the request is limited to a maximum length of 100,000 characters execute webhook example here is an example demonstrating how a webhook can be executed using the rest api for this example, we assume that a webhook has been configured with an endpoint extension value of mytestwebhook the action that the webhook is configured to execute should have a variable called webhookbody as part of the update variables and stored values block url https //{tenant url}/api/rest/webhooks/execute?extension=mytestwebhook \<font color="#ffffff">method\</font> post header name authorization rest api key \<font color="#ffffff">request body\</font> key value value format value body text (json or xml) { “somedata” “somedatavalue”, “otherdata” “otherdatavalue” } for xml, you need a parent node, such as webhookbody, so the action can process the request correctly \<webhookbody> \<name>project\</name> \<summary>summary\</summary> \</webhookbody> \<font color="#ffffff">status code\</font> 200 unsuccessful responses webhook not found or missing extension scenario you try to use a webhook that doesn't exist or you omit the extension part of the url url https //{tenant url}/api/rest/webhooks/execute?extension=nonexistentwebhook or https //{tenant url}/api/rest/webhooks/execute \<font color="#ffffff">method\</font> post header name authorization rest api key \<font color="#ffffff">request body\</font> key value value format value body text (json or xml) { “somedata” “somedatavalue”, “otherdata” “otherdatavalue” } \<font color="#ffffff">status code\</font> 400 bad request \<font color="#ffffff">message\</font> non existent webhook { "errorcode" "unhandledsystemexception ", "message" "unhandled system exception invalid webhook extension provided " } missing extension { "errorcode" "unhandledsystemexception ", "message" "unhandled system exception webhook validation failed for execute operation errors you must enter an endpoint extension to your base url " } incorrect authorization scenario you are trying to use an incorrect or deactivated rest api key for authorization url https //{tenant url}/api/rest/webhooks/execute?extension=mytestwebhook \<font color="#ffffff">method\</font> post header name authorization rest api key (incorrect or deactivated) \<font color="#ffffff">request body\</font> key value value format value body text (json or xml) { “somedata” “somedatavalue”, “otherdata” “otherdatavalue” } \<font color="#ffffff">status code\</font> 401 unauthorized \<font color="#ffffff">message\</font> { "code" "ism 4001", "description" "invalid session key or authentication token", "message" "", "help" "" } body is too long scenario you are trying to use a request body that is longer than 100,000 characters url https //{tenant url}/api/rest/webhooks/execute?extension=mytestwebhook \<font color="#ffffff">method\</font> post header name authorization rest api key \<font color="#ffffff">request body\</font> key value value format value body text (json or xml) { “somedata” “somedatavalue”, “otherdata” “otherdatavalue” } greater than 100,000 characters \<font color="#ffffff">status code\</font> 400 bad request \<font color="#ffffff">message\</font> { "errorcode" "unhandledsystemexception ", "message" "unhandled system exception request body must be less than or equal to 100,000 characters" } incorrect endpoint or wrong case scenario you are trying to use a webhook extension that was incorrectly typed url https //{tenant url}/api/rest/webhooks/execute?extension=blahblahwebhook \<font color="#ffffff">method\</font> post header name authorization rest api key \<font color="#ffffff">request body\</font> key value value format value body text (json or xml) { “somedata” “somedatavalue”, “otherdata” “otherdatavalue” } \<font color="#ffffff">status code\</font> 400 bad request \<font color="#ffffff">message\</font> { "errorcode" "unhandledsystemexception ", "message" "unhandled system exception this webhook extension doesn't exist " }
