Web request help


#1

1) Give a description of the problem
I am trying to add annotations into my local Grafana instance through their API. I am trying to make a POST request, and it is failing. I have now installed Postman so I can see what exactly is in the POST request, and the BODY is wrong. The headers look right, but the body shows the variable name and not just the content.

2) What is the expected behavior?
I have created a string variable with this value, which is correct for Grafana, verified by posting from cUrl:
{“dashboardId”:2,“time”:1516121558000,“isRegion”:false,“text”:“Everyone has departed”}

What is actually being sent from WebCore is:
{“Annotation”:"{“dashboardId”:2,“time”:1516121558000,“isRegion”:false,“text”:“Everyone has departed”}"}

Grafana chokes on that text, because I want to send just the content of the variable, not the variable itself.

3) What is happening/not happening?
Is there any other way to populate the body than just with a variable?

**4) Post a Green Snapshot of the piston!

5) Attach any logs (From ST IDE and by turning logging level to Full)


Sending POST with JSON array
Web Request POST to internal server - JSON problems
How can I include a bracket in the output of an expression?
Graphing Presence
#2

WebCoRE currently has limited support for web request body but fortunately your case will work just fine. Instead of passing a single variable you will need to allow webCoRE to generate the JSON by passing in individual variables for each of dashboardId, time, isRegion, and text. At this time it is not possible to send a raw request body like you wanted here, but webCoRE can handle single-level JSON payloads provided that the keys can be expressed in variables.


#3

Ah, great idea! I can do that. Thanks for the help.

Will mark as solved once I can reconfigure and test…