Skip to content

gabsuren/phone_book_service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phonebook Service

INTRODUCTION

Phonebook service provides simple APIs allowing users to login and manage contacts.

All contact management calls are authenticated.

SETUP AND RUN

1. ./setup
2. python main.py

API ENDPOINTS

User API

  • User registration
    /user/register method POST

    Required parameters
    {
      "username": "my-username",
      "password": "my-password"
    }

    Registers new user to the system.

  • User Login
    /user/login method POST

    Required parameters
    {
      "username": "my-username",
      "password": "my-password"
    }

    Allows a user to login returning a session token that should be sent in all authenticated calls.

####Contacts API

  • List Contacts
    /contacts
    Returns all contacts of the current user

  • Create Contact
    /contacts', methods=['POST']

    Required parameters
    {
      "first_name": "contact-first-name",
      "last_name": "contact-last-name"
    }

    Allows a user to create contact with the given first_name and last_name

  • Update a Contact's name
    /contacts/<int:contact_id>', methods=['POST']

    Required parameters
    {
      "first_name": "new-first-name",
      "last_name": "new-last-name"
    }

    Allows a user to update contact's first_name and last_name

  • Delete a Contact
    /contacts/<int:contact_id>, methods=['DELETE']

    Allows a user to delete contacts with the specified contact id

  • Add a Phone number
    /contacts/<int:contact_id>/entries, methods=['POST']

    Required parameters
    {
      "phone": "+1 (555) 123-456"
    }

    Allows a user to add phone number to contact

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published