Rotating API Address

Hey guys,

I have a question about APIs.

I’ve set up a workflow that whenever a user clicks a button, an email is sent to mail-tester.com with his unique credentials, which then generate a unique page with this structure for the slug/url: https://www.mail-tester.com/mailwarm-clientID-currenttimestamp

This page can also be displayed as JSON using this url: https://www.mail-tester.com/mailwarm-clientID-currenttimestamp&format=json

Here’s an example: https://www.mail-tester.com/mailwarm-32-11-03-09&format=json

I have no problems calling this API with the Bubble API connector, however seeing that each user has his own API address which is also changed every time he requests a new report, I’m not sure how to proceed.

Basically I’d like to be able to show results from the user their report in a dashboard, and update that information with data from their latest report. So in theory a user could request a report today (generating API URL #1), and then request another report next week (generating API URL #2).

Any tips on this one?

Edit: one idea I had was to store each URL in a datasheet and then see if I can use them from there, but not sure how that would take place… :slight_smile:

1 Like

You just need to use [client_id] in the url to be able to fill this part dynamically.
So the link will look like. I also put the current timestamp to be dynamically populated.

https://www.mail-tester.com/mailwarm-[clientID]-[currenttimestamp]&format=json

1 Like

Was just reading some posts of yours in a different thread, thanks for all the help on here!

Final question:could I also set it up this way?

image

If so, am I doing anything wrong here?

1 Like

Yes you can. I was not sure about the timestamp. So if the timestamp it always the same, You can do that :wink:

1 Like

Thanks, but then I’m doing something wrong and I’m not sure what… :slight_smile:

Here’s the error when I try to initialize the call:

This is the setup:

And this is the param I’m trying to include for each user:

image

Am I missing something?

Did you enter a value in appID key value field to initialize the call?

I didn’t, I thought that value would be dynamically updated depending on the unique data that each user has in that field.

What should go in there?

FYI the ‘apiID’ structure is:

[mandatory part]-[unique user ID]-[date-custom-format]

So for user 32: mailwarm-32-10-3
for user 33: mailwarm-33-10-3 or tomorrow that would be mailwarm-33-11-3

Would this still be the right solution?

You need first to initialize call before you can use dynamic data. So enter manually a data like mailwarm-32-10-3 and initialize the call. Once it’s done, you can delete this and use action or Get API data and dynamically fill this field using the correct DB query (like do a search or current user…)

1 Like

For the timestampp, I recommend to use a different part like I show you in my initial suggestion
You need to change it everyday,
so the best will be to use Current Date:formatted as… and set the format to match 10-3

So the call will look like this:
https://www.mail-tester.com/mailwarm-[clientID]-[currenttimestamp]&format=json

You will set dynamically clientID using the correct query to your DB like Current user’s appID in clientID value and use Current date formatted as (and set the correct format to get 10-3 in the currentimtestamp field).

This fixed it! :smiley:

I just didn’t know where to go after the initial call, but after some clicking around + reading this (Dynamic API set up) topic it’s now working.

Thanks so much for your time!

1 Like