Giter VIP home page Giter VIP logo

sample-api's Introduction

SUNTECH SIMPLE API

How to Setup

API infomation

baseUrl: http://localhost:8000

1. List Product

GET: {baseUrl}/api/products

Parameters: No Request body: No Response:

[
    .....
    {
        "name": "Test product 3 (test edit)",
        "price": "5000000",
        "description": "product 3",
        "id": "xWbk1Ck9-ba7uQZZiFxpL"
    }
    .....
]

2. Show Product

GET: {baseUrl}/api/products/:id

Parameters: No Request body: No Response:

{
    "name": "Test product name",
    "price": "1000000",
    "description": "Test product description",
    "id": "rovKMQRGxpAUUQet_dE7W"
}

3. Create Product

POST: {baseUrl}/api/products

Parameters: No Request body:

{
    "name": "Iphone 12",
    "price": "25000000",
    "description": "Thông tin chi tiết sản phẩm Iphone 12"
}

Response:

{
    "success": true
}

4. Update Product

PUT: {baseUrl}/api/products/:id

Parameters: No Request body:

{
    "name": "Iphone 12",
    "price": "25000000",
    "description": "Thông tin chi tiết sản phẩm Iphone 12"
}

Response:

{
    "success": true
}

5. Delete Product

PUT: {baseUrl}/api/products/:id

Parameters: No Request body:

{
    "name": "Iphone 12",
    "price": "25000000",
    "description": "Thông tin chi tiết sản phẩm Iphone 12"
}

Response:

{
    "success": true
}

6. List User

GET: {baseUrl}/api/users

Parameters: No Request body: No Response:

[
    .....
    {
        "id": "5YsFNN42B14VYHhpDyizn",
        "name": "Administrator",
        "email": "[email protected]",
        "password": *****
    }
    .....
]

7. Show User

GET: {baseUrl}/api/users/:id

Parameters: No Request body: No Response:

{
    "id": "5YsFNN42B14VYHhpDyizn",
    "name": "Administrator",
    "email": "[email protected]",
    "password": ******
}

8. Create User

POST: {baseUrl}/api/users

Parameters: No Request body:

{
    "name": "Administrator",
    "email": "[email protected]",
    "password": 123456
}

Response:

{
    "success": true
}

9. Update User

PUT: {baseUrl}/api/users/:id

Parameters: No Request body:

{
    "name": "Test user update",
    "email": "[email protected]",
    "password": 123456
}

Response:

{
    "success": true
}

10. Delete User

DELETE: {baseUrl}/api/users/:id

Parameters: No Request body: No

Response:

{
    "success": true
}

11. Login

POST: {baseUrl}/api/login

Parameters: No Request body:

{
    "email": "[email protected]",
    "password": 123456
}

Response:

{
    "user": {
        "id": "id",
        "name": "Test user update",
        "email": "[email protected]",
    },
    token: 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI....'
}

sample-api's People

Contributors

huyennhat-dev 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.