This is a contact book application that allows the user to add, view, update and delete contacts.
- Node.js
- Express.js
- Mongodb
- Mongoose
To install necessary dependencies, run the following command:
npm i
To use the application, run the following command:
npm start
- GET /api/company - get all companies
- POST /api/company - create a company
-
- body
{ "name": "company name", "address": "company address", "mobileNumber": "company mobile", "instagramHandle": "company insta handle", "emailId": "company email" }
-
-
GET /api/contacts - get contacts
- query params
- mobileNumber, emailID, instagramHandle
- get specific contact with all company details
- comapanyId
- get all conatacts of specific company
- mobileNumber, emailID, instagramHandle
- query params
-
POST /api/contacts - create a contact
- query params
- companyId
- company ID to create the contact with
- companyId
-
- body
{ "name": "contact name", "address": "contact address", "mobileNumber": "contact mobile", "instagramHandle": "contact insta handle", "emailId": "contact email" } ```
- query params
-
POST /api/contacts/bulk - delete a contact
- query params
- companyId
- company ID to create the contact with
- companyId
-
- body
[ { "name": "contact name", "address": "contact address", "mobileNumber": "contact mobile", "instagramHandle": "contact insta handle", "emailId": "contact email" }, ... ]
- query params
-
PUT /api/contacts - update a contact
- update contact