Wednesday, October 29, 2014

wheezy web: RESTful API Design

In this article we are going to explore a simple RESTful API created with wheezy.web framework. The demo implements a CRUD for tasks. Includes entity validation, content caching with dependencies and functional test cases. The source code is structured with well defined actors (you can read more about it here).

Design

The following convention is used with respect to operation, HTTP method (verb) and URL:
List:   GET    /api/v1/tasks
Add:    POST   /api/v1/tasks
Get:    GET    /api/v1/task/{task_id}
Update: PUT    /api/v1/task/{task_id}
Remove: DELETE /api/v1/task/{task_id}
The task entity consists of the following attributes: task_id, title and status. The source code is available here. Please download before proceeding any further.