Just a silly little api to mimick an address book.
- CORS-ready
- Post whatever data you want, all it manages are the IDs
- Data stored by remote ip address, keep your ascii art to yourself
- Data is just in memory, so data resets with the app
Returns all contacts, there are a few by default
Example request:
$.getJSON('http://salty-atoll-4248.herokuapp.com/contacts')
Example response:
{
contacts: [
{
id: 1,
first: 'Ryan',
last: 'Florence'
}
]
}
Creates a new contact.
Example Request:
$.post('http://salty-atoll-4248.herokuapp.com/contacts', {
first: 'Stanley',
last: 'Stuart'
})
Example response:
{
contact: {
id: 2,
first: 'Stanley',
last: 'Stuart'
}
}
Returns the contact at id :contactId
.
Example Request:
$.getJSON('http://salty-atoll-4248.herokuapp.com/contacts/3')
Example response:
{
contact: {
id: 3,
first: 'Eric',
last: 'Berry'
}
}
Updates the contact at id :contactId
.
Example Request:
$.ajax({
url: 'http://salty-atoll-4248.herokuapp.com/contacts/3',
type: 'PUT',
data: {
first: 'five',
last: 'tanley'
}
})
Example response:
{
contact: {
id: 2,
first: 'five',
last: 'tanley'
}
}
Destroys the contact at id :contactId
.
Example Request:
$.ajax({
url: 'http://salty-atoll-4248.herokuapp.com/contacts/3',
type: 'DELETE'
})
Example response:
No content.
MIT-Style license.
Copyright © 2013 Ryan Florence