Dynamic API Header

i’m currently trying to build an API connection with the Bubble API plugin, however I am facing an issue. Please see below.

Call one: authenticates user and returns a JSON token

This JSON token then needs to go into the header of call 2 to authenticate it and any further calls

The question is how do I get a dynamic token into the header of subsequent calls?

Thanks in advance for your help

You can add your a Header by clicking here:

image

Remember to:

  • Put your value [between brakles] to make it dyanamic;
  • Don’t mark it as private so you can fill it during your workflow.

I checked that, but it doesn´t work. i am not sure if when get the data from the response ( json ) , in the second api call the format of the data doesn´t allow to call properly.

Did you already tryed to display the data you are sending to this second call in you page? Doing this you can analyze it…

What you want to send to this second call?? A JSON or a text?

Provide us with screenshots of what you are currently trying to do, if possible send us the API documentation, I would like to help you but just with the information you are providing seems kind of difficult!

1 Like

Hi,

Here is the API documentation. Tradeprint API Sandbox

As you can see, the first call will create a JWT that is required as a parameter in the subsequent calls.

If you can help me build this API in bubble I’d be willing to pay you or your time.

Thanks in advance.

You may need two different API setups.

JWT Auth is a separate drop-down in the Bubble Auth.

1 Like

Hey! Try to do it this way, I believe it works, I will describe the step by step and if you still have a problem, don’t hesitate to ask us!

First you have to create a new API, but at this point I believe you have it figured out! Then you need to configure your call exactly like I did, don’t forget two details, put the call type as “action” so that you can call through the workflow and authenticate users with their credentials, if applicable, and the body has to be RAW as the documentation says, this call will return you a token, this token you can save later in your database and then make all the calls you need later

Hope this helps, any questions feel free to send a message!