|
|
|
|
|
by skazka16
3980 days ago
|
|
Our team is currently working on building a pretty big internal API from scratch. I took a look at some popular APIs (twitter, facebook, twilio, etc.) as a starting point. All of them has its own structure of the response, as well as the way you interact with those APIs, i.e. one may use `order` field to sort the resultset, while the other one prefers `sort_by` instead. There is definitely nothing wrong about that. But most of us like standards. We try to follow specifications as much as possible, at least to make things more predictable. Long story short - we ended up with http://jsonapi.org/ - a complete specification for building JSON-based APIs. It supports such things as pagination, filtering, sorting, relationships, etc. All of us could implement it all very easily, but only God knows what is on the mind of an engineer, i.e. whether he likes /endpoint.json vs /endpoint?format=json. |
|