Simple API with some endpoints to serve the Angular frontend
It retrieves all the contacts from the database.
No body required
It will always return a 200 code with a list of the contacts' info.
It retrieves a contact from the database with a certain id.
No body required
It will return a 200 code with the contact info.
If the contact does not exist it will return a 404 code.
Create a new contact.
Add all the new contact info in the body, like:
{
"name": "New Name",
"phone": "600582123",
"notes": "Some notes here",
"secphone": "953428583",
"email": "[email protected]"
}
It will always return a 201. Any 5** error is due to the database capacity.
Edit existing contacts.
Pass the id
of the existing contact into the URL parameters.
The body sould contain all the updated contact content like this:
{
"name": "New Name",
"phone": "600582123",
"notes": "Some notes here",
"secphone": "953428583",
"email": "[email protected]"
}
It will return a 200 code if the id
exists.
Else a 404 code is returned.
Delete a certain contact from the contacts list.
Pass the id
of the existing contact into the URL parameters.
It will return a 200 code if the id
exists.
Else a 404 code is returned.