Specifying the API
The very first thing that has to be defined for any web API is the operations it will expose. According to the REST principles, an operation is exposed by an HTTP method and a URI. The action performed by each operation should not contradict the natural meaning of its HTTP method. The following table specifies the operations of our API in detail:
Method |
URI |
Description |
|
|
Retrieves all available contacts. |
|
|
Retrieves a single contact by its primary phone number. |
|
|
Updates a contact, if it exists. Otherwise, it creates a new contact. |
|
|
Creates a new contact. |
|
|
Deletes an existing contact. |
|
|
Retrieves all available groups that have contacts assigned. |
|
|
Retrieves a unique list of all the groups assigned to contacts. |
|
|
Deletes a group from all the contacts... |