December 2017
Intermediate to advanced
316 pages
6h 58m
English
Before creating any API, we should know what the specifications of APIs are in the form of a document. We showed a few examples in the previous chapters, including the URL shortener API design document. Let us try to create one for this Metro Rail project. Take a look at the following table:
| HTTP verb | Path | Action |
Resource |
| POST |
/v1/train (details as JSON body) |
Create |
Train |
| POST |
/v1/station (details as JSON body) |
Create |
Station |
| GET | /v1/train/id |
Read |
Train |
| GET | /v1/station/id |
Read |
Station |
| POST |
/v1/schedule (source and destination) |
Create |
Route |
We can also include the UPDATE and DELETE methods. By implementing the preceding design, it will be obvious for users to implement them ...
Read now
Unlock full access