How to send data to Parabola from Bubble with webhooks, and from Parabola to Bubble

Hi Parabola x Bubble Squad :wave:

Wanted to share some guidance on connecting Parabola and Bubble through our API connectors!

Authenticating Bubble

Bubble is authorized with an API key. You can retrieve this key in Bubble by going to Settings ā†’ API ā†’ Generate API Key within your Bubble App

  • In Parabola, under the ā€œAuthenticationā€ section of our API steps, you can set the Auth type to ā€œBearer Tokenā€, and paste your token in the box below
  • Also be sure to install the ā€œAPI Connectorā€ plugin from the Bubble plugin tab
  • While on the API tab, youā€™ll also want to check the boxes for all data objects youā€™d like to make accessible through API under the Enable Data API section, and also check the box that says Use field display for ID instead of ID for key names

NOTE: You can work with the API while on a Free Bubble plan if youā€™re testing with your development database, as indicated by the version-test part of the API endpoint URL. If you wish to use the API on your live Bubble app, youā€™ll need a paid plan.

Send data from Bubble to Parabola using a Webhook
  • Get your Parabola webhook URL, and initialize your call after setting up your API Connector, as seen below

  • In your workflows in Bubble, select the Plugin action ā€œParabola - Parabolaā€ and enter the appropriate JSON in the ā€œ(param.) messageā€ input field using dynamic Bubble values (ex. ā€œCurrent Userā€™s phone numberā€™s valueā€)

Pull Data from Bubble to Parabola using the "Pull from API" Step
  • Pagination: By default, the first 100 rows will be returned by the API until you add pagination settings. You can add these settings for cursor-based pagination in the ā€œPaginationā€ tab to return additional data. If youā€™re still not pulling in all rows, you can increase the ā€œMax pages to fetchā€

Screen Shot 2021-07-06 at 11.11.00 AM

  • Rate Limiting: Requests are rate-limited by default to 1,000 requests/minute per application and version (live / development)
Send data from Parabola to Bubble

Configuring Bubbleā€™s API

  • The dev endpoint and live endpoints are different - the dev endpoint will include ā€˜version-test.ā€™ You can test the API with a free Bubble plan, but will need to upgrade in order to access live endpoints

  • The endpoint should end in ā€œ/obj/keynameā€ (ex. if I have a data type called ā€œvideo,ā€ my endpoint should end in ā€œ/obj/videoā€)

  • In Bubble, check the proper boxes under ā€˜Settingsā€™ ā†’ ā€˜APIā€™ to enable Data API, and also enable the appropriate resources. Also be sure to check the box that says ā€œuse field display instead of ID for key name.ā€ If you donā€™t, Parabola will be unable to find the resource. This tab is also where you can generate an API key, which can be placed in the Authentication tab of the Parabola export step as a Bearer token

  • Under ā€œDataā€ ā†’ ā€œPrivacy,ā€ be sure to set privacy settings for the resources that you plan to create/ modify/ delete

  • You may also need to provide a Google Geocode API key and Google Map API key under the ā€œSettingsā€ ā†’ ā€œGeneralā€ tab in order to properly access your API

Configuring Parabola

  • Creating or Deleting fields in Bubble: Use a POST or DELETE request

  • Updating fields in Bubble: You can use a PATCH request to update fields in Bubble in your ā€œSend to APIā€ step. In the API Endpoint URL, you can add ā€œ{_id}ā€ to the end of the request to specify the object to be updated (ex. /obj/videos/{_id}). Feel free to reference Bubbleā€™s documentation here on PATCH requests.

NOTE: to get the recordā€™s unique Bubble ID, you can use the ā€œPull from APIā€ step to pull in the data with IDs, and then use the ā€œCombine Tablesā€ step to combine your new data with the existing IDs.

  • Trying to create new object in bulk? Check out Bubbleā€™s ā€œBulk create new thingsā€ endpoint

  • Request Body: In Parabola, in the ā€œSend to APIā€ step, the ā€œRequest Bodyā€ is where you ā€˜mapā€™ fields in Bubble to Parabola columns. This text box should include JSON like so:

{
	"dish": "{dish Title}",
	"url": "{Path URL}",
	"handle": "{handle}",
	"creatorID": "{message User}"
}

In this example, ā€œdishā€ is an attribute in Bubble, and ā€œ{dish Title}ā€ is a column in Parabola. To help format your JSON, reference a tool such as https://jsonlint.com/.

Good luck using Parabola to enrich and manipulate your Bubble data! Feel free to reply to this post with any questions or recommendations on how this post can be improved.

1 Like

I have an app that has users take assessments and save to bubble database.
These answers are run through a lengthy listing of jobs, where we do calculations, which provide results on each job across dozens of elements.
My goal in the Flow is to PULL the Assessment Answer records for each user (once theyā€™ve finished them), run the Flow to calculate the results, and POST them as new records in the DB in a ā€˜Resultā€™ table.
When those records are created, the User can view them on subsequent pages of my app.

I have not done, well, any endpoint mapping between APIs, so this new.
Currently, I am trying to figure out how to set up: A) the webhook so that bubble can trigger the Flow B) get the data firing correctly through the flow, and C) initializing the API request to POST back to Bubble.

Webhook
I have a webhook link from Parabola, yet no clue where to put it in bubble so that it triggers the start of this flow.

Data for Flow
Should I remove the ā€œimport from Bubbleā€ step and replace it with something else, as I see that Webhooks and this PULL from ā€˜sources cannot receive inputsā€™ error when attempting to link them?
Doing a test on this last week, I was able to PULL from my appā€™s database. Can I pull only 1 userā€™s records from a table of records, or is this outside the actionā€™s scope?

Export POST to Bubble
Again, last week I set up a CSV email that showed good data results from the Flow.
Now though, Iā€™m not getting what I want (this may be because the PULL request maxes out and is getting new data that isnā€™t relevant).
When I have tried each time to initialize the call, on Bubbleā€™s side (using the detect data option for my API workflow), I get a blank response. On Parabola side, Iā€™m getting a 404.

Hi @Andrew_Clark,

Check out this thread that @Adam_R created outlining how to send webhooks from Bubble to Parabola.

The Send data from Bubble to Parabola using a Webhook has detailed instructions on how to configure up your webhook URL.

If you want to catch the data that is sent with your webhook, use the ā€œReceive from Webhookā€ step. You do not need to use the ā€œPull from an APIā€ step.

Note: Use this method if you want to process a single record linked to your webhook event. For example, sending the userā€™s record that performed the action.

However, if you simply want your webhook to trigger your flow and pull in a list of all records from a database, you can simply use the ā€œPull from an APIā€ step.

For exporting data to Bubble, feel free to share a request example. We can help you configure your request. The thread that Adam created should also have some useful resources for sending data to Bubble!

Thanks, @daniel
How do I do it so the webhook (of a single userā€™s record) triggers the Flow for the PULL from API? Or is this in the Pull from{ā€¦} step?

I need to get one userā€™s testing data, which will be approximately 130 records.

While the webhook info you sen in that link was helpful, I need more info. It essentially tells me how to start something, but Iā€™m not use the right steps to get going. (I know how to start the car, but I need to drive it somewhere).

My goal is to use Parabola to calculate a list of jobs with calculated fields for each user.
ideally, iā€™m doing a job-code, job-title, score, user-id, POST. There are roughly 900 rows in total, so it fits nicely under Bubbleā€™s limit per request. IF Iā€™m reading this correctly, I should set up the JSON body with these fields having the ā€œbubble-fieldā€ : ā€œ{parabola-field}ā€, ā€œbubble-fieldā€ : ā€œ{parabola-field}ā€
There is your new beta operation to PULL and POST to Bubble, but do you recommend using the PULL and POST to API instead?

Also @daniel My thinking is that we have the userā€™s actions in my Bubble app signal the start of the PULL from API to Parabola. Iā€™d ideally like this to PULL only that userā€™s information. Iā€™m at a loss right now of how to constrain the PULL to only be their user unique id. Is it a webhook that sends the id as a request and that is added to the PULL from API action? I donā€™t want to have duplicate data.

Hi @Andrew_Clark,

In Parabola, head to the flow that youā€™d like to enable webhooks on. Go to the settings tab and click Configure Webhooks. Copy the Webhook URL to your clipboard.

Next, head to your Bubble application and select the Plugins tab on the left-hand sidebar. If you havenā€™t done so already, you will need to add the API Connecter as a new plugin.

In the API Name section, you can fill out basic credentials. Click Add a shared header and set the Key to content-type and the Value to application/json.

The bottom section will allow you to configure your API call. Be sure to select Use as Action. Select POST as the method, and enter your Webhook URL using the input field to the right of the method.

Configure your JSON body to reference the Bubble fields and their dynamic values using <>.

In the example above, Iā€™m referencing my id field from my user table, and dynamically inserting the id. You will see a Key and Value appear below. This is for you to send test the call to ensure itā€™s correct. I entered a random value of 123.

Note: It will trigger your flow as soon you click Initiliazie call or Reinitialize call.

Next, head to your Workflow tab and select the event you want to trigger your action. Add a Plugin action and you should see the API Connector we just recently set up - Parabola - API Call.

You can set the action to occur based on a condition of the Current User. As a result, the current userā€™s id should be sent to your Parabola flow.

In Parabola, your flow should match this basic framework:

The ā€œReceive from webhookā€ will catch the user information defined in your request. The ā€œEnrich with an APIā€ step will allow you to dynamically query the users testing data by inserting that at the end of your API endpoint URL.

https:/your-application.bubbleapps.io/version-test/api/1.1/obj/user/{id}

Finally, you can use the ā€œSend to an APIā€ to map the fields in Bubble to the related columns in Parabola.

{
  "Bubble_Field_1": "{Parabola_Column_1}",
  "Bubble_Field_2": "{Parabola_Column_2}",
  "Bubble_Field_3": "{Parabola_Column_3}"
}
1 Like

This is very helpful. Most tuts show the initialization, but not the execution.
Iā€™m not having any issues for getting data from bubble; if anything I get too data, as I want records that have a column reference a user.

I did a mock data try in the Webhook action, then enrich with an api action. My results were simply the webhook being a new column, appended to each received record. This is not what I want. I want ONLY the records from the User-id referred by the webhook.

Iā€™d like to pull say 130 records from the testing table that have the user-id associated with each record.
Since my data is in the testing table (bubble-speak is ā€˜typeā€™) & each record referencing my user, does this mean the URL params need to have a constraint as obj/testing ā€¦ constraints ā€¦ user is {id} ?

I have these data types: user, tests, results-tests
Each test has 130 records for a user.
We need to call the tests table for only those records of a particular user (hopefully referred to in the webhook). Then Parabola does its magicā€¦ creates a set of new results-tests records for this user.

Another way to say itā€¦
I need to call the bubble DB testing type and find the records for a specific user who just finished creating these records, then calculate some things, using this Flow, and afterward, send back data to bubble and Create new records (in bulk) for a different table/type with 8 columns for each row.

Iā€™m reading through bubbleā€™s API documentation and seems I also need to do a Bulk Edit, which is different than a single createā€¦ Reference | Bubble
Problem looks like they want a content-type as plain/textā€¦
" Note that the ā€˜Content-Typeā€™ header of the request should be text/plain , not application/json ."

Note for thread: I have set up a Backend Workflow to accept the export. I use the steps in the workflow to map the values to the appropriate bubble fields. This is restricted again to text, number, or plain format, or option sets Iā€™ve created. This means any of the data linked to other types of things doesnā€™t work. I can use the unique id field or slug field as ā€˜textā€™ in a search, but that doesnā€™t solve create records.

Hi @Andrew_Clark

Did Parabola catch a webhook that received a column containing the user id from the webhook?

Taking a look at Bubbleā€™s documentation, when using the Data API, you should be able to search a table by getting a thing by its ID.

https://appname.bubbleapps.io/api/1.1/obj/typename/{unique_id}

However, the unique_id associated with your testing table is not the same as the user id. As you mentioned, it may be best to use a constraints parameter in your URL to search your testing table for all records where the user id is equal to the column value containing the user id from the webhook.

Our send to an API sends cannot send a content-type of text/plain. That step will also send an individual request per row, so itā€™s may not be necessary to use the Bulk Edit method. The bulk action is happening in Parabola!

Lastly, are you able to modify your table directly without triggering a workflow and using the Data API instead? That way you can simply map the fields in your table to the related column in Parabola.

Feel free to reply back with an email, and we can schedule some time to hop on a call. Happy to provide as much support with configuring your data in Parabola, but it may be best to reach out to Bubble directly with any questions around searching tables, setting up workflows, and mapping fields!

1 Like