Designing and building the API

Before writing the code, we need to have a neat idea in mind of the resources we are going to make available through the API, the methods we will provide to manipulate such resources, and the response codes we will deliver to the clients. After designing the API, we can start write some code to implement resources representation.

Resources, URLs, HTTP verbs, and response code

Defining a resource is very similar to defining a model class in an ORM system, and it's not uncommon for them to coincide, like in our case. In fact, we will provide the following resources:

  • Note
  • NoteFile
  • ChecklistItem

Every resource will be identified by a URL. We omit the hostname here for clarity:

  • The /notes URL: This identifies a collection of ...

Get Python for Google App Engine now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.