Hacker News new | ask | show | jobs
by albemuth 5233 days ago
The pattern used in Rails would be something like api.test.com/teacher/1234/students
1 comments

I was just reading up on the Graph API Facebook uses and its pattern is just api.test.com/1234/students. There seems to be very little standardization. The tutorial I'm reading right now wants me to pass the id in as a parameter. Weird.
Facebook's REST APIs seem pretty casually designed. "api.test.com/students/1234" is better URL design than "api.test.com/1234/students". You could then naturally guess to use "api.test.com/students" to get a list of students whereas with "api.test.com/1234/students" you'd end up having to do something weird like "api.test.com/all/students".