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:readandlocations: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, onlyGET /meand 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:
| Header | Value |
|---|---|
Authorization | Bearer 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.
- 1Choose Retrieve PollCreate a Zap and choose Webhooks by Zapier as the trigger, with the Retrieve Poll event.
- 2Set the URLSet URL to the list to watch, for example
https://api.bubbl.tech/platform/v1/campaigns?limit=50for new campaigns, orhttps://api.bubbl.tech/platform/v1/locations?limit=50for new locations. - 3Point Zapier at the itemsSet Key to
data, the field that holds the list, and Deduplication Key toid, so Zapier starts the Zap once for each id it hasn't seen before. - 4Add the header and testAdd the
Authorizationheader and test the trigger. Zapier shows the newest items; each one's fields, such asname,statusandstarts_at, are then available to later steps.
A few things to know:
- Zapier only reads the first page of the list, so set
limithigh enough to cover what can be created between two checks. The maximum is 100. - Deduplicating on
idmeans the Zap runs for new items. Editing a campaign doesn't trigger it again. To act on changes as well, use your own script withupdated_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.
- 1Run it every dayChoose Schedule by Zapier as the trigger with the Every Day event, and pick a time after midnight in your workspace's time zone.
- 2Get yesterday's summaryAdd Webhooks by Zapier with the GET event. Set URL to
https://api.bubbl.tech/platform/v1/reports/summary, and under Query String Params setstartandendboth to yesterday's date asYYYY-MM-DD(Zapier's Formatter step can make it). Add theAuthorizationheader. - 3Add a rowAdd Google Sheets with the Create Spreadsheet Row event, and map the summary's fields, such as
meta.start,data.totals.delivered,data.totals.devices_reachedanddata.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:
| Field | Value |
|---|---|
| Method | POST, PATCH or DELETE |
| URL | The endpoint, such as https://api.bubbl.tech/platform/v1/locations/import |
| Data | The JSON body, with fields from earlier steps inserted |
| Headers | Authorization: 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).
- 1Trigger on a new rowChoose Google Sheets as the trigger with the New Spreadsheet Row event, and pick your spreadsheet and worksheet.
- 2Add the Custom Request actionAdd Webhooks by Zapier with the Custom Request event. Set Method to
POSTand URL tohttps://api.bubbl.tech/platform/v1/locations/import, and add theAuthorizationandContent-Typeheaders. - 3Build the bodyPaste the JSON below into Data. Replace each value in capitals with the matching field from the Google Sheets step, using Zapier's field picker.
- 4Test and publishTest the step with a sample row. The response's
data.summaryshould show onecreated. Turn the Zap on.
{
"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_idmakes 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
200even 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'sfailedcount is more than 0, and send yourself a message. See Importing locations with GeoJSON.