Last active
August 29, 2015 14:19
-
-
Save smellymonk/6b0b8aabcfe9bd43ee28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": "/contacts" | |
}, | |
"_embedded": { | |
"contact": [{ | |
"_links": { | |
"self": { "href": "/contacts/1" } | |
}, | |
"name": "Bob Marley", | |
"telephone": "123-456-7890", | |
"email": "[email protected]", | |
"birthdate": "01/11/1990", | |
"address": "123 Jersey St, New York, NY 10001" | |
}, | |
{ | |
"_links": { | |
"self": { "href": "/contacts/2" } | |
}, | |
"name": "John Smith", | |
"telephone": "123-456-7890", | |
"email": "[email protected]", | |
"birthdate": "02/20/1980", | |
"address": "123 Jersey St, New York, NY 10001" | |
}] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GET /contacts returns the list.
POST /contacts with a payload of a contact/person JSON (with name, telephone, etc) will create a contact.
GET /contacts/id returns the contact
POST /contacts/id updates the contact based on the contact/person JSON payload.
DELETE /contacts/id removes the specified contact.
Note that I think we might add authentication on specific deletes later. We can talk about this. E.g., trying to edit or delete /contacts/1 works fine, but /contacts/2 requires authentication. Just something to consider. It shows that the authentication is reactive (stateless).