API call based on date?

I need to create an initial API call (not enrichment), in which a date parameter is dynamic based on the current date. For example, if I was running it today, I might want it to pass a query with date parameters for the next seven days - obviously “next seven days” is relative to the date today. How can I do this?

Yep, have definitely run into this myself too. We recently added a step, “Date & Time Import,” which you can use as your first step and then use the API Enrichment step after. In your API enrichment step, you can pull pull in the column value by wrapping the column name in { }, which will refer to the date value you have there. So, the API enrichment endpoint could look like something api_endpoint.xyz/endpoint1?date={date_value}.

2 Likes

This doesn’t work if I need a timestamp variable delivered to endpoint as a header as opposed to inserting it into the URL.

How can I achieve a timestamp variable as a header?

THanks

Hey @Richard_Foxworthy,

We don’t support adding dynamic variables into headers just yet, though I’m sure many users would find it useful.

If you’d like, feel free to make a post in the Feature Requests section on our community forum. Another user requested a similar feature here:

2 Likes

I second that!! My token is changing every hour and so I obviously can’t handle that manually???

1 Like