Using RestAPI with dynamic endpoint URL

Stimulsoft BI Designer discussion
Post Reply
notme
Posts: 3
Joined: Mon Mar 11, 2024 1:19 pm

Using RestAPI with dynamic endpoint URL

Post by notme »

Hi,

we are just testing Stimulsoft, so probably my question is really newbee like ;-)

In our reports we want to get the data from a backend via RestAPI. The response is JSON formatted data.
So I thought that the "JSON Data" source is the right one. But the endpoint URL can vary, e.g. in development the backend runs on localhost, in production on a "real" server.
We would like to use a parameter/variable instead of the fixed URL:
json.png
json.png (23.36 KiB) Viewed 1146 times
Is this possible, and if so how?

Thanks,
Christian
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using RestAPI with dynamic endpoint URL

Post by Lech Kulikowski »

Hello,

You can use a variable and use in it path to JSON file.

Thank you.
Attachments
Screenshot 2024-03-12 092532.png
Screenshot 2024-03-12 092532.png (25.15 KiB) Viewed 1131 times
notme
Posts: 3
Joined: Mon Mar 11, 2024 1:19 pm

Re: Using RestAPI with dynamic endpoint URL

Post by notme »

Hi Lech,
very cool :D - I like your system more every day!

Thanks,
Christian
Max Shamanov
Posts: 792
Joined: Tue Sep 07, 2021 10:11 am

Re: Using RestAPI with dynamic endpoint URL

Post by Max Shamanov »

Hello,

You are Welcome!
notme
Posts: 3
Joined: Mon Mar 11, 2024 1:19 pm

Re: Using RestAPI with dynamic endpoint URL

Post by notme »

Hi again,

we just noticed that variables in the URL work like a charm, but not in the Headers like so:
header.png
header.png (29.34 KiB) Viewed 1003 times
We pass the AuthToken as variable to the report, so that it can call the rest endpoint.
Is there any other way to get this working? Or could this be implemented?

Thanks!
Christian
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Using RestAPI with dynamic endpoint URL

Post by Lech Kulikowski »

Hello,

Unfortunately, in the Headers it is not possible to use variables.

Thank you.
Post Reply