Although this talk is mostly slanted towards language APIs, I thought I'd share some tips for writing Web APIs:
- Don't roll your own auth.
Use HTTPS and include username/password in POST parameters.
- Avoid Sessions.
- Strict REST is overrated:
Browser support is universal for GET and POST, and patchy for everything else.
- Make URLs easy to construct
- Use GET requests to read data from your server.
Use POST requests when changing data on your server.
- Requests: URLencoded parameters
- Response: URLencoded parameters, CSV, or JSON. Avoid XML.
- Asynchronous responses:
Let the user set a POST url to their web service in the request.
- JSONP for browser based APIs