4 ms·
What I'm looking for in an API is convention and some common set of rules. As long as the API has an understandable structure and good documentation, I'm happy.
by emerongi 3y ago
What I'm looking for in an API is convention and some common set of rules. As long as the API has an understandable structure and good documentation, I'm happy.
The first case would be preferred if the API is for e.g. general queries of companies in some region. The second case might be preferred if your API only deals with those specific companies and has a different structure for each one (for good reasons).
You can also provide both APIs - one for general data, and one for specific details.
- throwaw12 3y agoThese are good observations, thank you! > The first case would be preferred if the API is for e.g. general queries of companies in some region. The second case might be preferred if your API only deals with those specific companies and has a different structure for each one (for good reasons). At the moment, I don't know if we will expand to the second use case. Because scope is limited and data set is also limited (mostly contains generic data). I think in that case it might make sense to go with option 1 and eventually introduce v2 which covers option 2.
- stop50 3y agoI would rather implement a generic list that contains only common attributes, type and then an url that points to /agencies/:id . /agencies and the others are in this case aliiases for an fikter on /organizations if possible.