Quantcast
Viewing all articles
Browse latest Browse all 20396

cURL request for API access - JSON error

Hi,

So I have been playing with the API access as we use slack and hubot to deploy and control a lot of day to day things.

 

This is the command I am running

 

curl -u 'solarwindsadmin@globalad.org:PASSWORD' -o output.json -H "Content-Type: application/json" -k -X POST -d @test.json https://10.199.0.22:17778/SolarWinds/InformationService/v3/Json/swis://lonsolarwinds.globalad.org/Orion/Orion.Nodes/NodeID=6/CustomProperties

jazor -c output.json


test.json:

{

"Comments":"test from hubot"

}

In hubot I can wrap all of this in coffeescript.

 

The command works - as in it changes the value of comments but has this error:

 

E, [2014-09-23T15:30:47.643348 #42940] ERROR -- : 757: unexpected token at 'null' (JSON::ParserError)

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse'

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse'

/Library/Ruby/Gems/2.0.0/gems/jazor-0.1.8/lib/jazor.rb:22:in `parse'

/Library/Ruby/Gems/2.0.0/gems/jazor-0.1.8/bin/jazor:89:in `<top (required)>'

/usr/bin/jazor:23:in `load'

/usr/bin/jazor:23:in `<main>'



Am I going about this all wrong btw? This has got to be the most complicated API I have ever used.


Thanks


Rob


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>