I am working with the Particle device and want to drive it using hptutils2.
The html required is as follows..
<!DOCTYPE>
<html>
<body>
<center>
<form action="https://api.particle.io/v1/devices/...oken=bec1daef10297164128006b00xxxxd8cf1bdee2b" method="POST">
Tell your device what to do!<br>
<br>
<input type="radio" name="args" value="on">Turn the LED on.
<br>
<input type="radio" name="args" value="off">Turn the LED off.
<br>
<input type="submit" value="Do it!">
</form>
</center>
</body>
</html>
I have tested the html version and it works.
I am doing the following.
I am sending
https://api.particle.io/v1/devices/...daef10297164128006b00xxxxd8cf1bdee2b,value=on
I get back an error of "error": "invalid_token",
But the token is correct.
if I remove the ,value=on then I get no value provided.
It would appear I am not parsing the value correctly.
Can anyone help.
The html required is as follows..
<!DOCTYPE>
<html>
<body>
<center>
<form action="https://api.particle.io/v1/devices/...oken=bec1daef10297164128006b00xxxxd8cf1bdee2b" method="POST">
Tell your device what to do!<br>
<br>
<input type="radio" name="args" value="on">Turn the LED on.
<br>
<input type="radio" name="args" value="off">Turn the LED off.
<br>
<input type="submit" value="Do it!">
</form>
</center>
</body>
</html>
I have tested the html version and it works.
I am doing the following.
B4X:
Sub Button1_click
HTTP = "https://api.particle.io/v1/devices/3B002B000Axxxxxx38383138/toggle?access_token=bec1daef10297164128006b00xxxxd8cf1bdee2b"
Log("LED On ")
job1.Initialize("Job1", Me)
Dim OnOff As String
OnOff = "on"
HTTP = HTTP & ",value=" & OnOff
Log ("HTTP " & HTTP)
job1.Download(HTTP)
End Sub
I am sending
https://api.particle.io/v1/devices/...daef10297164128006b00xxxxd8cf1bdee2b,value=on
I get back an error of "error": "invalid_token",
But the token is correct.
if I remove the ,value=on then I get no value provided.
It would appear I am not parsing the value correctly.
Can anyone help.