i have a POST API that requires some filter to return data and I wanted to use that API as data source when the user saves the report and re-opens it should get data from that source based on the filters.
Hello, Zain!
Thank you for writing to us.
Flexmonster supports multiple ways of connecting through the API. Firstly, you can implement GET requests returning JSON or CSV data. Please check the following pages for more information about these data sources:
Secondly, you can implement a custom API, our communication protocol for connecting to any custom data source based on your server.
Could you please clarify which API connection approach you are referring to? This would greatly help us to provide more accurate recommendations. Additionally, for more information on the aforementioned connection approaches and their comparison, please check the following article: https://www.flexmonster.com/blog/how-to-choose-the-best-data-source-to-use-with-flexmonster/
We are looking forward to hearing from you.
Best Regards,
Maksym
I am referring to custom API, I have an API with a method post that requires some parameters that the user will select from the custom UI once the user submits I have to call an API with flexmonster.
Hello, Zain!
Thank you for your reply.
Please note that Flexmonster does not support directly connecting to POST endpoints. If you want to connect your API to Flexmonster and preserve filters present in the request, we recommend implementing a proxy GET endpoint on your server that transfers the URL parameters to your POST request.
According to the provided request screenshot, here is how you could convert the request body to URL parameters:
GET {{base_url}}/api/BusinessPlanning/DistributionDrillDown?Distributions=[5]&DrillDownParameter=DistStoreWiseSalesTrend
These URL parameters will be saved within the data source, and when it is reopened, the data will be fetched again.
Hope you will find our answer helpful.
Best Regards,
Maksym