Using variables?

I need to set a query parameter on a REST API call that changes each time I call the API. Examples include paging, date, or an id. How is this done in Parabola?

There are a few ways to do this! Pagination is built into the API Import - so if you have a cursor or just a page=n parameter, the advanced settings can be configured to do that. If you need to swap in IDs or dates or other dynamic data, the best way is to use the API Enrichment step, and pass in a table of those dynamic values. You can merge them into your URL by referencing the name of the column, wrapped in {curly braces}, like this: https://my.api.service.com/resource/{id-column-name}

My API Get for our purposes use curly brackets in the URL. I’m getting conflicts that the curly bracket variables I’m passing for my API conflicts with the API Enrichment step, erroring with the message a column doesn’t exist (it thinks my curly requests to my API is asking for curly columns in the Enrichment API).

Example of my API GET:
https://app.nottodaysatan.com/api/1.1/obj/customer?constraints=[{“key”:“Modified Date”,“constraint_type”:“greater than”,“value”:“2022-04-01T00:00:00Z”}]

Hi @Bryan_Mannos happy to help with this!

It seems like in your URL Parameters, you will want to reformat the { } brackets into URL encoding.

To do this, replace any curly brackets that are not referencing a column name with encoded characters like %7B (opening curly bracket) and %7D (closing curly bracket).

[%7B

“key”: “Modified Date”,

“constraint_type”: “greater than”,

“value”: “2022-04-01T00:00:00Z”

%7D]

The square brackets in the array shouldn’t cause issues, but similarly you can use encoded characters %5B (opening square bracket) and %5D (closing square bracket).

%5B%7B

“key”: “Modified Date”,

“constraint_type”: “greater than”,

“value”: “2022-04-01T00:00:00Z”

%7D%5D

Let us know if you have any questions!

1 Like

Thank you Emory!

This lead me down the right path, but for reference sake for anyone else with this issue, I had to URL encode the whole JSON string ({getdate} is my passed Parabola date string)

%5B%7B%22key%22:%22Modified%20Date%22,%22constraint_type%22:%22greater%20than%22,%22value%22:%22{getdate}%22%7D%5D