Hello,
Setup in use: Using latest Grafana 10.2.1 with Raspberry Pi OS 64-bit version, Debian 12 based. Raspberry Pi’s IP address is 192.168.1.98.
I tried to repeat the first example in https://docs.influxdata.com/influxdb/v1/tools/api/#write-http-endpoint web page using the button element in the Canvas panel. The original example in the Influxdata web resource is as follows:
curl -i -XPOST "http://localhost:8086/write?db=mydb&precision=s" --data-binary 'mymeas,mytag=1 myfield=90 1463683075'
I tried to set the Canvas panel button options as follows:
API endpoint: http://192.168.1.98:8086/write
Method: POST
Content-Type: x-www-form-urlencoded
Query parameters:
db mydb
precision s
Header parameters: {none}
Payload: ‘mymeas,mytag=1 myfield=90 1463683075’
Grafana communicates OK with the InfluxDB, but it seems that the last single quote character is interpreted as part of the timestamp value and InfluxDB throws the following error after pressing the Test API button:
An error has occurred:
{"status":400,"statusText":"Bad Request","data":{"error":"unable to parse ''mymeas,mytag=1 myfield=90 1463683075'': bad timestamp","message":"unable to parse ''mymeas,mytag=1 myfield=90 1463683075'': bad timestamp"},"config":{"url":"http://192.168.1.98:8086/write?db=mydb&precision=s","method":"POST","data":"'mymeas,mytag=1 myfield=90 1463683075'","headers":[["Content-Type","application/x-www-form-urlencoded"]],"retry":0,"hideFromInspector":false}}
I have tried many forms of the payload field, with double quotes, braces, brackets, escape characters, and with other values of Content-Type field: JSON, text etc
Please help me to finalize this. Http GET method is already working