Only pulling recent entries from API

I’m trying to use the “Pull from an API” action, and I’m successfully getting results, which I can filter for those created after a certain timeframe:
e.g.
https://myactivecampaigndomain.api-us1.com/api/3/contacts?filters[created_after]=2021-01-01

Is there any way that each time the request runs, it pulls in data from the last 7 days - i.e. can the “created_after” filter be dynamic?

Hey Jacob :wave:

Good question! Try using the Start with date & time row step to add the current date and time to your flow. You’ll want to set the Day's Offset value to -7.

To format your dates in a YYYY-MM-DD format, use the Format dates step and target your Current DateTime column.

You should now be able to pass the dynamic value in that column to an endpoint using the Enrich with an API step. Just wrap your column in curly brackets. Your endpoint might look like this:

https://myactivecampaigndomain.api-us1.com/api/3/contacts?filters[created_after]={current DateTime}

2 Likes

Hi @daniel amazing, I’m almost there, but I tried what you mentioned and I’m getting caught up with the following error

Here’s the input tab of that window:

Hey @Jacob –glad you’re getting close here :slight_smile: It looks like there’s a + in the API Endpoint URL with {Current+DateTime}. Can you try removing that + and see if it works?

1 Like

Hi @andrew
The + was automatically added to the URL by Parabola when I entered the URL parameters.
Now that I’ve deleted the + and replaced it with a space, it looks like it’s working now :slight_smile: thank you!

@andrew hmm except every time I go to modify any part of this step, the + gets added back in there, so I have to keep taking it out.
I’m concerned if I let this run itself, it may also revert to the + and error.

Hey @Jacob, that’s odd…let me flag for our engineering team and get that sorted out for you. Thanks for flagging!

@Jacob flagged with our engineering team and it is indeed a bug. We’ll get it fixed as soon as possible. For now, you should be able to edit the URL directly (not the parameters) and it should work. Will you give that a try and let me know? Happy to give you additional credits to experiment with in the meantime (can you send us a note at help@parabola.io and I’ll get that settled for you?).

1 Like