SENDHTTPPOST Workflow Application
The SENDHTTPPOST workflow application lets you create outgoing webhooks to external systems. Webhooks allow an API to exchange information with other applications through HTTP POST requests, and can be used to build integrations with extendable applications such as Slack, GitHub, and Dropbox. For example, they can be used for notifications when an expected event (as previously configured by the user) has occurred. Since they allow real-time communication, webhooks are efficient and performant.
The SENDHTTPPOST workflow application sends outgoing webhooks to external applications using JSON or URLENCODED payloads. SENDHTTPPOST will then receive and process the response from the external API. For more information, see the Using webhooks with WorkflowGen topic on the WorkflowGen Forum & Knowledge Base.
For an example of how you can use SENDHTTPPOST to send messages to Slack channels from WorkflowGen, see Workflow Application: Using SENDHTTPPOST to send messages to Slack. As well, samples of APIs that use SENDHTTPPOST are available in the SENDHTTPPOST Workflow Application repository on GitHub.
- The default payload content type (
APP_CONTENT_TYPE) is JSON; URLENCODED is also supported.
- Since the application parameters are case-sensitive, parameters must use the API’s accepted notation.
- The SENDHTTPPOST application requires the
APP_URLparameter, which corresponds to the external API URL.
TOKENparameter is available for authentication for external APIs where the token is not included in the URL. In these cases, the token will be sent in the payload using the
- The response can contain an optional payload mapped to user-defined OUT parameters.
- In case of error when then
APP_RESPONSE_STATUS OUTparameter is not defined, an exception will be triggered;
2xxHTTP response status codes are successful responses.
- Besides the optional parameters listed below, you can also add additional custom IN and OUT parameters (specific to the external API) to send and receive custom user-defined data to and from the external API. For example, in a Slack integration, you can add a parameter to include an emoji in a Slack message, and map this to Slack’s
"icon_emoji"parameter (this is the Slack API’s accepted notation for this particular parameter).
- The default timeout (
APP_TIMEOUT) is 3000 milliseconds; the maximum timeout is 60,000 milliseconds.
- The HTTP request headers can be defined with the
xxxis the header field name.
- The default maximum response length is 4194304 characters (4 MB); this default value can be modified by setting the
SendHttpPostMaxResponseLengthparameter value in the
- Application logs are available; these can be specified by setting the
SendHttpPostLogLevelparameter value in the
0to disable logging,
2for simple logs, or
3for debug logs.
A payload created by SENDHTTPPOST to send a message to a Slack channel would look something like this:
"text": "This is a test",
A payload created by SENDHTTPPOST to send nested JSON to be converted into objects by an external API would look something like this:
"Zipcode": "XXX XXX"
The parameters defined above will generate two headers in the request payload:
Authorization: Bearer AbCdEf123456
When setting the parameter
Y, it will convert the JSON into an array:
"street": "160 Guy Street",
"zipcode": "J4G 1U4"