Our new Goal:
Add a Button that does the following:
On Button click, query the Azure Data Source plugin, retrieve the results (as we do on grid), Send the results to a “backend”
1.1 The “backend” will upload the results data to 3rd party API
The question is, With this design, what is best to use as backend:
My first thought would be that you’d need a panel plugin that queries the data source on click, and then sends it to a data source.
Since panel plugin can’t (shouldn’t really) make authenticated requests, you’d have to select the data source it should post the data to.
Unfortunately, data sources are designed for reading data from, and don’t have a formal way of writing data back. If you write the data source yourself, you can implement a method that writes back, and have the panel call that method directly.
You could also build an app plugin with a backend, and configure a resource handler, which essentially gives you an authenticated web server with a custom endpoint, that can handle any HTTP requests.
Thanks for reply.
If I want to make a button panel that send http post to a webservice i wrote,
What is the best way to acheive this?
What plugin can I use? I tried the push button with Rest call, but kept getting a Cors error that i dont allow origin headers…
Should my client use a backend plugin that will send the rest http post?
If so, what plugins should i choose? For client to communicate with backend plugin
Please note that any credentials stored in a panel are NOT encrypted. If you make requests from a panel directly to your API, any secrets are stored in cleartext.
Most (if not all) data sources only support reading data. There is no official support to post data to an external API.
If you want to support this, you need to build a custom panel plugin and a custom data source.