Home
The Toolkit for Online Communities
15899 Community Members, 0 members online, 2449 visitors today
Log In Register

Forum OpenACS Q&A: providing RESTful apis

OpenACS Home : Forums : OpenACS Q&A : providing RESTful apis

Icon of Envelope Request notifications

+
Posted by Jeff Rogers on
I'm looking at providing an api to my application. There already exists the xml-rpc server and it has a nice clean interface to let packages register their own apis there. But xml-rpc feels a bit antiquated and a little more complicated to deal with than a simple REST api (using the term loosely; basically meaning a simple url GET with query parameters).

Is there anything I've missed for providing this kind of service? If it's not already there, is there any interest other than mine? It's not difficult to provide this sort of thing as one-off behavior, but it would be nice to have a general way to do it that handles things like managing API keys, handling input in plain xml or json format, and similarly encoding the results.

+
2: Re: providing RESTful apis (response to 1)
Posted by Brian Fenton on
Hi Jeff

I know Frank Bergmann did some work around this for Project Open. It could be worth searching for some of his posts here.

best wishes
Brian

+
3: Re: providing RESTful apis (response to 1)
Posted by Dave Bauer on
Seems like it is a good idea.

Don added json-procs.tcl to acs-tcl package last August, very handy.

http://cvs.openacs.org/browse/OpenACS/openacs-4/packages/acs-tcl/tcl/json-procs.tcl

Basically you need an API to register procs that can return a datasource you can convert to/from JSON.

In general, I find you still need to end up writing specific procedures since very few applications use simple objects, although maybe with acs-object-management you could manage different views and provide those with JSON.

+
4: Re: providing RESTful apis (response to 3)
Posted by Dave Bauer on
If you look at acs-object-management it gives you the tools to build up views/forms based on object types that would be useful to develop the data structures used in an restful API.