Using Workflow to Push to a 3rd Party API

WizeHive's workflow system can execute actions upon certain events (triggers). One of these actions - called "Push to API" - offers the ability to push data about an event to a 3rd party API. 

Setting it up

Creating the "Push to API" action

To set it up the "Push to API" action, simply head to the Workflow tab, then Workflow Actions, and create a new action:

The  HTTPS Endpoint URL on the 3rd party's server will receive a form POST from WizeHive' server each time a relevant event occurs. This must be HTTPS (with an "s") to ensure communications remain secure.
The  Failure Retry Time is the amount of time WizeHive's server will wait to re-send the POST if there is an error when initially sending it. An error occurs whenever the 3rd party's endpoint URL cannot be reached, or the endpoint URL returns an HTTP status code outside the 200 range.
The  Max Tries count is the amount of times in total that WizeHive's server will try to re-send the POST to the 3rd party before it gives up.

Making note of the security token

After pressing Save Action, click on the Edit button in the Actions screen and make note of the special security token that has been automatically generated:

This security token will be sent to the 3rd party API in every request. The 3rd party can use this token to verify that the request is originating from WizeHive.

Associating the action with a trigger

Now head over to the Triggers section. When creating a new trigger or editing an existing trigger, simply associate the "Push to API" action with it, save, and everything is set.

Please note that the "Push to API" action works with the following triggers:

  • New submission
  • Page moved
  • Form saved

Receiving data

Each trigger sends a data payload (as a form POST) to the 3rd party API. Some pieces of this payload are standard, while others are tailored to the event that triggered it.

Some general information about this data:

  • The security token will always be located in Auth.hash
  • The exact time the workflow trigger fired will always be located in WorkflowEvent.created
  • The workflow trigger that fired will be located in WorkflowTrigger.*
  • The workflow action that fired will be located in WorklowAction.*
  • Data relevant to the specific event that fired will vary, and is documented below.
  • All dates will be delivered in the UTC time standard, with a format of "2012-07-30 18:00:00".

Below are example data payloads that are delivered for each available trigger:

New submission

Array (     [Auth] => Array         (             [hash] => 7a979b9226bfd9197507bbc99ca22ddb         )      [WorkflowEvent] => Array         (             [created] => 2012-08-10 18:00:49         )      [WorkflowTrigger] => Array         (             [id] => 3             [workspace_id] => 1             [type] => 4             [name] => Form saved             [description] => Form saved             [created] => 2012-08-10 17:59:59             [modified] => 2012-08-10 17:59:59         )      [WorkflowAction] => Array         (             [id] => 1             [workspace_id] => 1             [type] => 6             [name] => Push to API             [description] => Push to API             [created] => 2012-08-10 17:58:55             [modified] => 2012-08-10 17:58:55         )      [Record] => Array         (             [id] => 1             [workspace_id] => 1             [record_folder_id] => 0             [name] => Test Record Name             [description] =>              [is_deleted] => 0             [deleted_date] =>              [created] => 2012-08-10 18:00:35             [modified] => 2012-08-10 18:00:35         )      [FormSubmission] => Array         (             [id] => 1             [form_id] => 1             [record_id] => 1             [user_id] => 1             [is_deleted] => 0             [deleted_date] =>              [created] => 2012-08-10 18:00:49             [modified] => 2012-08-10 18:00:49             [user_type] => normal         )      [FormResponse] => Array         (             [0] => Array                 (                     [id] => 1                     [form_submission_id] => 1                     [form_field_id] => 1                     [value] => John                 )              [1] => Array                 (                     [id] => 2                     [form_submission_id] => 1                     [form_field_id] => 2                     [value] => Doe                 )          )  )

Page moved

Array (     [Auth] => Array         (             [hash] => 7a979b9226bfd9197507bbc99ca22ddb         )      [WorkflowEvent] => Array         (             [created] => 2012-08-10 18:03:45         )      [WorkflowTrigger] => Array         (             [id] => 1             [workspace_id] => 1             [type] => 2             [name] => Page moved             [description] => Page moved             [created] => 2012-08-10 17:59:47             [modified] => 2012-08-10 17:59:47         )      [WorkflowAction] => Array         (             [id] => 1             [workspace_id] => 1             [type] => 6             [name] => Push to API             [description] => Push to API             [created] => 2012-08-10 17:58:55             [modified] => 2012-08-10 17:58:55         )      [Record] => Array         (             [id] => 1             [workspace_id] => 1             [record_folder_id] => 1         )  )

Form saved

Array (     [Auth] => Array         (             [hash] => 7a979b9226bfd9197507bbc99ca22ddb         )      [WorkflowEvent] => Array         (             [created] => 2012-08-10 18:00:49         )      [WorkflowTrigger] => Array         (             [id] => 3             [workspace_id] => 1             [type] => 4             [name] => Form saved             [description] => Form saved             [created] => 2012-08-10 17:59:59             [modified] => 2012-08-10 17:59:59         )      [WorkflowAction] => Array         (             [id] => 1             [workspace_id] => 1             [type] => 6             [name] => Push to API             [description] => Push to API             [created] => 2012-08-10 17:58:55             [modified] => 2012-08-10 17:58:55         )      [Record] => Array         (             [id] => 1             [workspace_id] => 1             [record_folder_id] => 0             [name] => Test Record Name             [description] =>              [is_deleted] => 0             [deleted_date] =>              [created] => 2012-08-10 18:00:35             [modified] => 2012-08-10 18:00:35         )      [FormSubmission] => Array         (             [id] => 1             [form_id] => 1             [record_id] => 1             [user_id] => 1             [is_deleted] => 0             [deleted_date] =>              [created] => 2012-08-10 18:00:49             [modified] => 2012-08-10 18:00:49             [user_type] => normal         )      [FormResponse] => Array         (             [0] => Array                 (                     [id] => 1                     [form_submission_id] => 1                     [form_field_id] => 1                     [value] => John                 )              [1] => Array                 (                     [id] => 2                     [form_submission_id] => 1                     [form_field_id] => 2                     [value] => Doe                 )          )  )

Still need help? Contact Us Contact Us