New webservice API

Pierre-Yves Chibon pingou at
Sun Jan 27 10:26:39 PST 2013

On Sun, 2013-01-27 at 10:05 -0800, Dirk Hohndel wrote:
> On Jan 27, 2013, at 1:42 AM, Pierre-Yves Chibon wrote:
> > Hi,
> > 
> > I have spent the afternoon trying to re-design the API to make it a little more
> > as it should have been from the beginning.
> > 
> > Changes includes:
> > - change in the routes/urls
> >  - concerns everything, all the user part is under /api/user/{new,lost}/ and
> > 	all the dive part is under /api/dive/{add,get}/
> > - change in the request mode to use
> >  - POST is used to upload new dives
> >  - GET is used to retrieve someone's dives
> >  - the header 'Content-Type: text/xml' has to be used to retrieve the dives in
> > 	xml format instead of the default json.
> > 
> > All these changes are in the 'new_api' branch of the git, I will not merge
> > before I get your ok as it will requires some changes on the Android application
> > as well as the desktop application.
> > 
> > Let me know what you think of the changes and what can be changed/improved.
> > 
> > There is still one thing I need to work on though, the possibility to delete
> > your user and with it all your dives.
> Pierre, could you post a brief API description, noting what is implemented and what you are still planning to add?

The API is described at /api/ all my changes are in a separate branch
for the moment though.

Basically the api is
* user
- new user:
- lost login:

* dives
- add dive:
arguments to provide in POST:
'login': The login identifier
      * 'dive_latitude': The latitude
      * 'dive_longitude': The longitude
      * 'dive_date': Date (format: yyyy-mm-dd)
      * 'dive_time': Time (format: hh:mm(:ss))
      * 'dive_name': The dive name

- retrieve dive:
By default it will return json, to ask for the xml output, set the
'Accept' header to 'text/xml'.

To implement:
- register login using POST or GET
- lost login using POST or GET
- Delete user using POST or GET

These are more related to the android application and the webservice
interface as the client doesn't use them.

Let me know if I can help with something else.


More information about the subsurface mailing list