There are downsides to each situation, for both the developer and the API provider. Include/Exclude Certain FieldsĪn API with a single approach to responses is likely to give developers much more or less data than they need. What about when you need to plan for what Daniel calls the “one-size-fits-all REST API?” Here are three different ways you can help developers declare the data they want from your API. This made sense because they are supporting a “small group of known developers” mostly inside Netflix. There is a translation layer that queries for the exact data needed by a client. In 2012, Netflix’s Daniel Jacobson shared how they created a unique endpoint for every device the company supports. Some APIs provide flexibility in the types and amount of data in their responses to help mitigate this.įor example, Netflix realized that to support the many devices that stream its videos, it needed a more flexible approach to its API. There are plenty of circumstances where what’s returned is not quite what a developer wants, though. That’s by design developers need to know what to expect. Most APIs deliver their responses the exact same way to every client.
0 Comments
Leave a Reply. |