ZenLlama
2012-10-28 16:54:09 UTC
ZenLlama [http://community.zenoss.org/people/ZenLlama] created the discussion
"POSTing JSON API information via cURL"
To view the discussion, visit: http://community.zenoss.org/message/69596#69596
--------------------------------------------------------------
Hi,
I'm +attempting+ to start performing some rather basic JSON API calls via PHP's cURL implementation. Being quite new to Zenoss, PHP, and JSON alike it's been a bit of a slog. I've had decent luck fetching and posting data via the Python API, but JSON has for me thus far been stubborn.
If anyone has a moment, can you provide an example of any proper basic HTTP request for the JSON information for a call in the API? An example would be fetching all devices in device class Server...I'm a bit unclear as to what the base URL should be and what format the POST data should take. Perhaps cURL isn't the best way of doing this?
Unfortunately implementing in PHP and doing so from a remote host are both necessary, as I'll be incorporating this as an extension to an existing PHP-based application.
Thanks in advance, and obviously should I solve my own problem first I'll post back. I've been through the forums, API examples, etc with precious little luck.
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69596#69596]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
"POSTing JSON API information via cURL"
To view the discussion, visit: http://community.zenoss.org/message/69596#69596
--------------------------------------------------------------
Hi,
I'm +attempting+ to start performing some rather basic JSON API calls via PHP's cURL implementation. Being quite new to Zenoss, PHP, and JSON alike it's been a bit of a slog. I've had decent luck fetching and posting data via the Python API, but JSON has for me thus far been stubborn.
If anyone has a moment, can you provide an example of any proper basic HTTP request for the JSON information for a call in the API? An example would be fetching all devices in device class Server...I'm a bit unclear as to what the base URL should be and what format the POST data should take. Perhaps cURL isn't the best way of doing this?
Unfortunately implementing in PHP and doing so from a remote host are both necessary, as I'll be incorporating this as an extension to an existing PHP-based application.
Thanks in advance, and obviously should I solve my own problem first I'll post back. I've been through the forums, API examples, etc with precious little luck.
--------------------------------------------------------------
Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69596#69596]
Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]