This sample uses the HTTP Action to integrate with Zapier when invoked. This allows you to connect your contract to several hundred pre-built connectors such as Salesforce, Clio and Google Sheets.

See the reference documentation for Custom Actions for guidance on how to use this transformation.

{
  "$class": "io.clause.outbound.physical.Http",
  "url": "YOUR_ZAPIER_WEB_HOOK_URL",
  "method":"POST",
  "body":{
      "date":response.timestamp, 
      "note":"Fragile Goods Update",
      "amount":event.amount.doubleValue
   }
}

Creating a Zap on Zapier

Create your zap, and choose Webhooks as the trigger from the list of built-in apps.

Then when configuring your webhook, choose the Catch Hook option.

webhook setup on zapier

Zapier will generate a unique URL for your integration. You should use this in your contract code, so that Clause knows where to send your data.

i.e. replace YOUR_ZAPIER_WEB_HOOK_URL in the code above with the value in this field.

webhook setup on zapier

Sending a test message during setup of Zapier is crucial as this allows Zapier to know the format of messages it will recieve. It is recommended that you use the Clause /trigger REST API to emit a test message.

webhook setup on zapier

Once successful you can use the Action editor to configure your connection to Google Sheets and to map the fields from your test message. You should choose Create Spreadsheet Row from the Google Sheets action wizard.

Note. Your spreadsheet should already exist on Google Sheets before you try this step.

webhook setup on zapier