uniqush / uniqush-push

Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.
http://uniqush.org
Apache License 2.0
1.54k stars 201 forks source link

RESTful API #55

Open x0bandeira opened 9 years ago

x0bandeira commented 9 years ago

A RESTful API would make integration and learning curve much simpler

monnand commented 9 years ago

Yes. I agree. However, this would break the API. I think I will make this change in version 2.0, which is currently under development (well.. sort of. I almost suspended the development in recent months for personal reasons. I will restart working on this project today.)

monnand commented 9 years ago

@rafaelbandeira3 BTW, Any suggestions about the RESTful API? I'm considering something like:

x0bandeira commented 9 years ago

Some objective considerations on API design, things may vary as you have more understanding of the underlying domain than I do:

x0bandeira commented 9 years ago

From a release management standpoint, assuming the functionality of the RESTful endpoints is equivalent to existing endpoints, and thus doesn't require changes to the existing domain, just to the HTTP handling layer, then the RESTful API should be added before 2.0 wherever it doesn't conflict with the existing API, or all namespaced if it conflicts in any point. So existing functionality remains unchanged but new users already start building off the intended design without having to wait for another batch of functionality that doesn't change how they work. Then documentation for the old API should still live but with a deprecation disclaimer.

monnand commented 9 years ago

Thank you, @rafaelbandeira3 ! Your comments answered a lot of my questions. This really helped me a lot. If everything works well, I can work on this project (almost) full time after this holiday season.

mishan commented 8 years ago

@command3r We're working on making uniqush-push more REST-ful, expect to see some improvements pushed upstream very soon.

tleyden commented 8 years ago

If you used Swagger to document the REST API then client libraries in various languages could be automatically generated.

TysonAndre commented 7 years ago

Additionally, for a new restful API, should set proper content-type of application/json in the response

Another idea for a rest API would be support for various forms of authentication in the config for access within a datacenter, e.g. shared secret in HTTP header (Even with that, one should prevent the uniqush service from being publicly accessible)

Future API changes should have different endpoint paths (E.g. beginning with /v2/), and exist alongside old endpoint paths for a few releases to make migration easier.

Still haven't decided on a RESTful choice of endpoint paths.

Error messages should be more descriptive, include all of the (guaranteed to be) missing fields instead of just the first one? (Can add to current rest version)