Replies: 1 comment
-
I fixed it by now. I followed this Tutorial from Volkvo Labs. Import is, that their Javascript Code is incorrect when preparing the Paylod. It should look like
With this fix my test now works. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR How to Include a dynamically changing Body in a Request created by Business Forms Plugin.
Hello,
I'm trying to use a Grafana Panel as a file Upload. My Setup is a Grafana Instance and a simple Python Flask API. Both Running on the same Server. Important is, that the API is not accessible by my Client, it is just internal in the Grafana Network. So Grafana itself has to make the requests to my API Endpoint.
This is why I use the Infinity Data source to send API Calls to my Endpoint from Grafana. This part does work, the API is reachable by the Data source.
Because I need my User to give Data to my API (in later Terms a file encoded as a base64 String, but for now anything would be lovely) this seems to be a challenge. I'm using the Volkvolabs Business Forms Plugin to achieve Data Transfer back to a Data source, but I can't find/ understand the documentation for doing this with a changing JSON Body.
The Data will be Sent in the Body of the API call, and I only find ways to provide a static Body to my API Call. Those Calls with static JSON Body do work and my API can be reached. But I need to include the data that is Input in the Business Forms in my JSON Body as well.
I have no background in Web Development, so the JavaScript Part of the Custom Code are hard for me. I think I have to prepare the payload (at least to encode the file as base64 String) but I can't change the Body of the Request dynamically at all.
Of course, I will be Happy to provide more Documentation of what my Setup looks like if needed.
Beta Was this translation helpful? Give feedback.
All reactions