Working with Zapier

# Triggering 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),

# Using 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'.

# Triggering 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)

# Get your bot working without Zapier first

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.

# Once your bot is working then add Zapier Integration

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.

# 1. Generate your 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.

# 2. Select Axiom's Zapier App within Zapier

Axiom is available as a trigger action, within Zapier.

# 3. Input your API Token

Input your API Token

# 4. 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.

# 5. 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.

# 6. Receive Data From Axiom

Within Axiom, use the step 'Receive data from another app' step, in step 1.

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.

You can use this data within your automation. Please note - we recommend getting your automation working independently of Zapier first, perhaps with hard-coded values, then subsituting data from Zapier.

# Sending more than 5 columns of data from Zapier

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"]]