Working with Zapier

# Trigger Zapier from Axiom

Axiom can be used to trigger any webhook, for example, in Zapier, Make/Integromat, or other apps that support webhook integration.

Please check the relevant documentation in your app to setup your webhook endpoint.

Here's Zapier's guide, for example. (opens new window),

# Use fetch to trigger Zapier

For more control, or to receive data back from Zapier, you will need to use a "Write javascript" step.

The code looks like this:

// Input your desired data below
const body = {
  first_name: "Wade",
  last_name: "Foster",
  age: 29
}

// Replace the URL below with the URL of your webhook
const url = "https://hooks.zapier.com/catch/123456/aDif37"

const rawResponse = await fetch(url, {
  headers: {
    "Content-type": "application/json"
  },
  method: "POST",
  body: JSON.stringify(body)
})
let content = await rawResponse.json()

// Manipulate the response data however you wish here.

return [[content]]

Data output from other steps can also be used here. For more information on how to do this, please see Inputting Data to 'Write Javascript'.

# Trigger Axiom from Zapier

Please Note: An Axiom Pro tier subscription or higher is required

Zapier shows a 403 error message without this tier (it doesn't display the message axiom sends back)

# Create a working bot without Zapier

A common mistake is to start building an Axiom with Zapier integration at the start.

This will result in a longer more confusing development process. First, get your bot working without Zapier integration. For example, you can test that axiom works with your site using hard-coded values.

Get to the point where your bot performs all necessary UI actions independently.

# Add Zapier integration after the bot works

Axiom has a Zapier app that can be used to trigger axioms. To use this, you'll need to export your API token from axiom.

# Generate an API token

Your API token can be generated from with the Axiom extension by clicking on the 'APIs and External Services' link in the main menu and clicking the Create API Token button. Please note down your API token and keep it somewhere safe, for security purposes it is not displayed within the extension. If you need to generate a new token it will invalidate previously generated tokens and you are then required to replace the invalid token anywhere that it has been previously used.

# Select Axiom's Zapier App within Zapier

Axiom is available as a trigger action, within Zapier.

# Input an API Token

Input your API Token

# Input the data to send axiom

Input the data to send axiom. First name the axiom you would like to trigger, then the columns of data you would like to send it.

We recommend sending one row of data to axiom at a time.

# Test the Zapier->Axiom Trigger

You should now see an option to 'Test Action' or 'Retest Action'. Click this, and if successful, axiom will send back a link with the message 'OPEN LINK IN BROWSER'. Copy-paste this link into your browser window to see axiom run.

# Receive Data From Axiom

There are two ways to send data to axiom:

  • Use Receive data from another app widget as the first step in your automation. The data sent when the automation is triggered will then be available to your automation as a token.
    • After you have tested the Zapier trigger, you'll see a preview of the data within the output of 'Receive data from another app'.
    • If the data preview is not up-to-date, reload your axiom and re-open this step to refresh the preview.
  • Use Read data from Google Sheet as the first step in your automation.
    • Before triggering your axiom, write to the Google sheet from Zapier.
    • This is our recommended approach, as it allows data to be inspected easily.

# Send more than 5 columns of data from Zapier via webhook

If you would like to send more than 5 columns of data, or multiple rows simultaneously, input a 2D Array into Column A of the Zapier App's form, as follows:

You can copy-paste this example of 6 columns. Please substitute A1, B1, C1 for the variables in Zapier:

[["A1", "B1", "C1","D1", "E1", "F1"]]

If you find formatting this data difficult, we recommend the alternative approach of writing data to a Google Sheet and using axiom's Read data from Google Sheet step