Giter Club home page Giter Club logo

phonebook's Introduction

REST API Phone book application

Phone book Rest API

Requirements

Java 8
Maven
Docker

Install

mvn clean install

Run the app

docker-compose build --no-cache
docker-compose up

Then navigate to localhost:8080 in your browser

Swagger documentation

Swagger documentation is available here

Run tests

mvn test

Postman collection

To use postman this is a ready collection

REST API

The REST API to phone book app is described below.

Get list of contacts

Get list of contacts based on criteria search param

Request

POST /v1/contacts/search/

curl -X POST \
  http://localhost:8080/v1/contacts/search \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 106' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: BBXSRF=6095fb9e-9af8-4c45-b9bc-45621deed00e' \
  -H 'Host: localhost:8080' \
  -H 'Postman-Token: 1fe01ce7-bc0d-4ce4-a328-d4e5b88f45d6,e9dca113-850b-46f7-9a50-3c4289fbddfe' \
  -H 'User-Agent: PostmanRuntime/7.16.3' \
  -H 'cache-control: no-cache' \
  -d '{
    "filterParam": "jack",
    "sort":{
        "order": "ASC",
        "field": "firstName"
    },
    "page": 0,
    "size": 10
}'

Create a contact

Request

POST /v1/contacts/

curl -X POST \
  http://localhost:8080/v1/contacts \
  -H 'Accept: */*' \
  -H 'Accept-Encoding: gzip, deflate' \
  -H 'Cache-Control: no-cache' \
  -H 'Connection: keep-alive' \
  -H 'Content-Length: 151' \
  -H 'Content-Type: application/json' \
  -H 'Cookie: BBXSRF=6095fb9e-9af8-4c45-b9bc-45621deed00e' \
  -H 'Host: localhost:8080' \
  -H 'Postman-Token: ffa9738e-799d-4fb0-99b7-4a14ed77f325,9dc62efd-d591-490f-b7f3-f3c96e55c1b8' \
  -H 'User-Agent: PostmanRuntime/7.16.3' \
  -H 'cache-control: no-cache' \
  -d '{
    "prefix": "Miss",
    "firstName": "Karen",
    "middleName": "Alejandra",
    "lastName": "Fa",
    "phone": "77777777777",
    "email": "[email protected]"
}'

phonebook's People

Contributors

jack1590 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.