Skip to content

This is a spring boot REST API that will enable a client to perform CRUD operations on the contact collection

Notifications You must be signed in to change notification settings

saieshwar/Spring-Boot-Restful-API-for-Contact-Entry-System-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring-Boot-Restful-API-for-Contact-Entry-System

This is a spring boot REST API that will enable a client to perform CRUD operations on the contact collection.

Reach out to me

LinkedIn Gmail


Execution

# To build the project standard maven build is sufficient
mvn clean install

# To start/run the project spring boot maven plugin is included just run
mvn spring-boot:run

# The integration test may be executed using
mvn test

Usage

Once the application is started,

To get all the contacts

[
    {
        "id": 1,
        "name": {
            "firstName": "Sai Eshwar",
            "middleName": "Reddy",
            "lastName": "Bobbili"
        },
        "address": {
            "street": "Barton",
            "city": "Charlotte",
            "state": "NC",
            "zip": "28262"
        },
        "phones": [
            {
                "number": "12345",
                "type": "personal"
            }
        ],
        "email": "[email protected]"
    }
]

To get specific contact

  • Goto http://localhost:8080/contact/{id} which return all the information about the contact.

    Goto: http://localhost:8080/contact/1 you will get contact with id =1 as below

    [
      {
          "id": 1,
          "name": {
              "firstName": "Sai Eshwar",
              "middleName": "Reddy",
              "lastName": "Bobbili"
          },
          "address": {
              "street": "Barton",
              "city": "Charlotte",
              "state": "NC",
              "zip": "28262"
          },
          "phones": [
              {
                  "number": "12345",
                  "type": "personal"
              }
          ],
          "email": "[email protected]"
      }
    ]
    

To add or update a new contact

  • Execute the following in cURL
##For update replace POST to PUT
$ curl -i -X POST -H "Content-Type:application/json" -d "{
        
        "name": {
            "firstName": "Akhil",
            "middleName": "Shetty",
            "lastName": "Madhamshetty"
        },
        "address": {
            "street": "Barton",
            "city": "Charlotte",
            "state": "NC",
            "zip": "28262"
        },
        "phones": [
            {
                "number": "12345",
                "type": "personal"
            }
        ],
        "email": "[email protected]"
    }"  

About

This is a spring boot REST API that will enable a client to perform CRUD operations on the contact collection

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages