I have been developing the new API for Open Classifieds for the last weeks. I have developed some other small API’s before, but this is another scope, and I am enjoying like a kid with new lego xD
This are the steps I followed
- Define the scope of what will be included.
- Get inspiration from other API’s.
- Learn more about best practices, took quite the time.
- Research for modules/bundles for PHP.
- Choose the authentication.
- Start developing
- Refactor
- Keep developing
- While developing doing documentation / testing
- Enjoy! 😀
Must Read
- Best practices API http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
- More best practices http://simonguest.com/2013/07/05/designing-a-web-api-for-mobile-apps/
- About authentication and against oauth, http://stackoverflow.com/questions/3963877/creating-an-api-for-mobile-applications-authentication-and-authorization
Tools
Chrome plugin Advanced Rest Client to make REST requests and save them, a must!
Generate documentation
We use Jekyll since we use it for the documentation at Open Classifieds, but there other nice one out there:
Open Classifieds API example
- Documentation (not brilliant but enough)
- Main controller for the API without auth. Auth by api_key, by user.
- Controllers for the api. All of them.
WordPress API example