I am working on integrating DashingIO with VC ... to update the widgets with new info they posted example of cURL ... and it look like this (for windows):
curl -X POST -H "Content-Type: application/json" -d "{ \"auth_token\": \"pass\", \"text\": \"Off\" }" http://localhost:3030/widgets/VoxCommando
i am trying to use scrape post, but I keep getting error:
JSON:: ParserError - 757: unexpected token at ' 'auth_token' : 'pass', 'text': 'Off' '
when I am using a command like the one below... I tried double qoutes ... with slashes and without ... non is working :bonk :bonk
anyhelp appreciated
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="878" name="Send Status to Dashing" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>Scrape.Post</cmdType>
<params>
<param>http://localhost:3030/widgets/VoxCommando</param>
<param> 'auth_token': 'pass', 'text': 'Off'</param>
<param />
<param />
<param>application/json</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
</command>
Sorry, but are you replacing 'pass' with your password? Seems like it might be expecting a password there?
That would explain the unexpected token.
But if it's working for you using cURL, then:
Have you tried using the curly brackets for the data-string parameter?
{ \"auth_token\": \"pass\", \"text\": \"Off\" }
For example, if you look at our earlier Instapush thread (http://voxcommando.com/forum/index.php?topic=1910.msg16480#msg16480), there the datastring is surrounded by curly brackets.
This is probably because they are using JSON, so the datastring needs to be in JSON format.
I'm not sure if you would need the escaping backslashes, but I would start by leaving them in.
Just talked to the boss.
James says it's extremely unlikely that you'll need the \'s in VC -- and that these are more likely to cause errors in VC.
you guys rock ... it was the curly brackets that are missing ... and no need for escape backslashes ...
thank you :) now I can go forward with developing my dashboard ..
Great.
If/when you have time, maybe you can post some VC-related dashing.io accomplishments and tips to the forum?
I was planning on that :)