ChangelogEdit pageSTAFFOpen dashboard

Using Bubbl with Zapier

Connect Bubbl to thousands of apps with Webhooks by Zapier and a Platform API token. Trigger Zaps from new Bubbl campaigns or locations, copy your reports into a spreadsheet, and send data into Bubbl from your other tools.

Bubbl doesn't have its own app in Zapier's directory. Instead, use Zapier's built-in Webhooks by Zapier app to call the Platform API. The same approach works in Make (the HTTP app) and n8n (the HTTP Request node): send the token in an Authorization header and call the endpoints on this page.

Before you start#

  • Create a token for Zapier in Configuration › Platform API, named "Zapier", with only the abilities your Zaps need. For the examples here: campaigns:read, locations:read and locations:write. See Authentication.
  • Build in the Sandbox first, with a Sandbox token and https://api.sandbox.bubbl.tech/platform/v1. When the Zap works, switch the URL and the token to Production. In Production, only GET /me and the reports work until Bubbl turns on the full API for your workspace (see Sandbox and Production).
  • Everyone who can edit your Zap can see the token in its headers, so give Zapier its own token and revoke it if you stop using Zapier.

Every request to Bubbl needs this header. In Webhooks by Zapier, add it under Headers:

HeaderValue
AuthorizationBearer bubbl_… (your token)

Check the connection#

To check the token before building anything, add a Webhooks by Zapier action with the GET event, set the URL to https://api.sandbox.bubbl.tech/platform/v1/me, add the header and click Test step. A working token returns your workspace's name, environment and the token's abilities.

Trigger a Zap from Bubbl#

Zapier can check a Bubbl list every few minutes and start the Zap for each new item. Bubbl's lists return the newest items first, which is what Zapier's polling needs.

  1. 1
    Choose Retrieve Poll
    Create a Zap and choose Webhooks by Zapier as the trigger, with the Retrieve Poll event.
  2. 2
    Set the URL
    Set URL to the list to watch, for example https://api.bubbl.tech/platform/v1/campaigns?limit=50 for new campaigns, or https://api.bubbl.tech/platform/v1/locations?limit=50 for new locations.
  3. 3
    Point Zapier at the items
    Set Key to data, the field that holds the list, and Deduplication Key to id, so Zapier starts the Zap once for each id it hasn't seen before.
  4. 4
    Add the header and test
    Add the Authorization header and test the trigger. Zapier shows the newest items; each one's fields, such as name, status and starts_at, are then available to later steps.

A few things to know:

  • Zapier only reads the first page of the list, so set limit high enough to cover what can be created between two checks. The maximum is 100.
  • Deduplicating on id means the Zap runs for new items. Editing a campaign doesn't trigger it again. To act on changes as well, use your own script with updated_since (see Pagination and syncing).
  • Each check is one request, and counts towards your rate limits.

Copy your reports into a spreadsheet#

This Zap adds yesterday's figures to a Google Sheet every morning. The token needs reports:read, which works in Production straight away.

  1. 1
    Run it every day
    Choose Schedule by Zapier as the trigger with the Every Day event, and pick a time after midnight in your workspace's time zone.
  2. 2
    Get yesterday's summary
    Add Webhooks by Zapier with the GET event. Set URL to https://api.bubbl.tech/platform/v1/reports/summary, and under Query String Params set start and end both to yesterday's date as YYYY-MM-DD (Zapier's Formatter step can make it). Add the Authorization header.
  3. 3
    Add a row
    Add Google Sheets with the Create Spreadsheet Row event, and map the summary's fields, such as meta.start, data.totals.delivered, data.totals.devices_reached and data.totals.geofence_entries, to your columns with Zapier's field picker.

For a row per campaign instead, call https://api.bubbl.tech/platform/v1/reports/campaigns and use Zapier's Looping by Zapier over data. See Reports for every field and filter.

Send data to Bubbl#

To create or change things in Bubbl, add a Webhooks by Zapier action with the Custom Request event:

FieldValue
MethodPOST, PATCH or DELETE
URLThe endpoint, such as https://api.bubbl.tech/platform/v1/locations/import
DataThe JSON body, with fields from earlier steps inserted
HeadersAuthorization: Bearer bubbl_… and Content-Type: application/json

When a request doesn't work, the response body has Bubbl's error.code and error.message, which say what to fix (see Errors).

Example: add stores from Google Sheets#

This Zap adds a location to Bubbl for every new row in a Google Sheet of stores, and updates it if the same store is added again. The sheet has the columns Store ID, Name, Latitude, Longitude and Radius (in metres).

  1. 1
    Trigger on a new row
    Choose Google Sheets as the trigger with the New Spreadsheet Row event, and pick your spreadsheet and worksheet.
  2. 2
    Add the Custom Request action
    Add Webhooks by Zapier with the Custom Request event. Set Method to POST and URL to https://api.bubbl.tech/platform/v1/locations/import, and add the Authorization and Content-Type headers.
  3. 3
    Build the body
    Paste the JSON below into Data. Replace each value in capitals with the matching field from the Google Sheets step, using Zapier's field picker.
  4. 4
    Test and publish
    Test the step with a sample row. The response's data.summary should show one created. Turn the Zap on.
DATA
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": { "type": "Point", "coordinates": [LONGITUDE, LATITUDE] },
      "properties": {
        "name": "NAME",
        "radius": RADIUS,
        "external_id": "STORE_ID",
        "group": "Stores"
      }
    }
  ]
}
  • Longitude comes first, as GeoJSON always has it.
  • Using the Store ID as external_id makes the Zap safe to run twice for the same store: the second run updates the location instead of making a copy. For the same reason, you can add a second Zap with Google Sheets' New or Updated Spreadsheet Row event and the same action, to keep Bubbl in step when a row changes.
  • The import answers 200 even when the feature fails, for example with a missing name or a radius outside 50 to 1,000 metres. To be told about those, add a Filter or Paths step after the request that checks whether the summary's failed count is more than 0, and send yourself a message. See Importing locations with GeoJSON.
Adding many rows at oncePasting hundreds of rows into the sheet starts hundreds of Zap runs, one request each, and the Sandbox allows 10 changes a minute. For a big list, import it in one request instead (up to 1,000 locations), and use the Zap for the rows added after that.