Ask HN: What is your go-to example for a good REST API?
401 pointsI tend to always look to api.github.com when I need a little inspiration.
Anyone have some good examples of a particularly well laid out API?
Anyone have some good examples of a particularly well laid out API?
Comments (182) 67 threads
Earlier commentsTo summarize: send a 202 for the initial request, redirecting to a job URL. The client polls on the job URL, which returns 200 with progress information until it's done, when it returns a 303 redirecting to the final output.
One particular problem spot is that many http libraries automatically follow the 303 redirect, and some even follow the 202 redirect.
I definitely think we would have been better off just putting status and final location information as JSON attributes in the body rather than putting it in HTTP response codes and Location headers. Non-standard, but much less confusing for our customers.
Long poll lets the polling be efficient.
Says who?
Maybe not "streaming". Maybe not "real time". But certainly asynchronous.
Continue this thread — 1 reply
[1] https://developers.digitalocean.com/documentation/v2/
https://api.slack.com/
Also, why can't I use a secret key with my basic postMessage script? I have to navigate OAuth2 just to make a post? Argh the pain!
http://apigee.com/about/resources/ebooks/web-api-design
1. https://www.amazon.com/REST-Practice-Hypermedia-Systems-Arch...
2. https://www.amazon.com/Building-Hypermedia-APIs-HTML5-Node/d...
3. http://www.designinghypermediaapis.com/
Our book study group covered this book a few years ago. This book is rational, its advice actionable.
Like "Agile", "REST" is merely a pretext to start an argument. Just do what works, focusing on reducing the cost of change (risk mitigation).
Continue this thread — 1 reply
The examples are PHP-based and there is an active Slack channel supporting the book.
http://www.vinaysahni.com/best-practices-for-a-pragmatic-res...
Oh and still is today because it's a good API - timeless
They have a plethora of getting started guides and examples that make it really easy to 'hello world' quickly.
You have to actually dig to get to the reference when you first sign up.
Hello world in 30 minutes or less is important for any API program.
All comments shown.
Couldn't load more comments. Check your connection and try again.