Experimental JSON output is here

9 views
Skip to first unread message

Pierre Far

unread,
Dec 28, 2008, 9:08:24 AM12/28/08
to Cli.gs Interested
Hello all

Hope everyone is having a great holiday :)

The API V2 development continues and now JSON output is supported on
an experimental basis. I'm aiming to have the JSON output be 100%
compliant with the JSON RPC 1.1 Working Draft as specified at
http://cli.gs/uR3Ye1 . It's almost there :)

To use it, just specify output=json in the query string. For example:

http://cli.gs/api/v2/cligs/create?key=YOUR_KEY&appid=YOUR_APP&url=http%3A%2F%2Fekstreme.com%2F&output=json

On success, it will return a JSON object along the lines of:

{"version":"1.1","result":{"clig":"http:\/\/cli.gs\/zUppUh"}}

The version here is the JSON RPC version *NOT* the API version. This
is required by the standard.

On error, it will return a JSON object along the lines of:

{"version":"1.1","error":{"name":"JSONRPCError","code":
404,"message":"Please provide a valid API key. If you want the clig to
be public, simply do not specify a key."}}

Again, the format is as specified by the JSON RPC document. The code
number and the message are exactly the HTTP code and message returned
on error as described in the Cligs API: http://blog.cli.gs/api .

Please test it out and please please please try to break it so I can
fix it :) Getting JSON support required some serious gutting of the
API code and so it needs quite extensive testing.

But the gutting is useful because next up is XML support. Once that's
tested, I'll be adding new APIs; top of the list to try out the new
system is /cligs/list because it's easiest to implement.

Cheers,
Pierre
Reply all
Reply to author
Forward
0 new messages