2 Replies Latest reply on Sep 23, 2014 10:56 AM by robsi

    cURL request for API access - JSON error



      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

      jazor -c output.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.