Metaservice RESTful API for building webapps, mobile apps, etc.

RESTful API Метасервиса для создания веб-приложений, мобильных приложений и т.д.

WorldOfPets 1e6bab9151 add documentation 2 anni fa
__pycache__ 898e63f9e0 a lot of changes: jwt, add classes, mailing list and other 2 anni fa
rest_venv 898e63f9e0 a lot of changes: jwt, add classes, mailing list and other 2 anni fa
README.md 1e6bab9151 add documentation 2 anni fa
api.py 898e63f9e0 a lot of changes: jwt, add classes, mailing list and other 2 anni fa
config.py 898e63f9e0 a lot of changes: jwt, add classes, mailing list and other 2 anni fa
connect.py 0f399d79e1 first push 2 anni fa
function.py 898e63f9e0 a lot of changes: jwt, add classes, mailing list and other 2 anni fa

README.md

REST API Python

Documentation

Instruction

  1. Change config.py
  2. Open cmd and go to cd C:/your_path/pythoRestApi/rest_api_venv/Scripts
  3. Entered the following commands activate.bat, cd ../../ and python api.py

Requests

GET http://127.0.0.2:8080/user/10 - get one user by id

{
    "birthday": "Tue, 07 Jun 2022 00:00:00 GMT",
    "id": 10,
    "idrole": 2,
    "insys": true,
    "lastlogintime": "Tue, 07 Jun 2022 19:25:00 GMT",
    "name": "Evgen4",
    "email" : "test@test.com",
    "password" : "1234"
}

GET http://127.0.0.2:8080/users - get all users

[
    {
        "birthday": "Sat, 04 Mar 2000 00:00:00 GMT",
        "id": 4,
        "insys": true,
        "lastlogintime": "Mon, 16 May 2011 15:36:38 GMT",
        "name": "Evgen Polivanov",
        "role_name": "Admin",
        "email" : "test@test.com",
        "password" : "1234"
    },
    {
        "birthday": "Tue, 07 Jun 2022 00:00:00 GMT",
        "id": 6,
        "insys": true,
        "lastlogintime": "Tue, 07 Jun 2022 16:58:29 GMT",
        "name": "Evgen Polivanov",
        "role_name": "User",
        "email" : "test@test.com",
        "password" : "1234"
    }
]

POST http://127.0.0.2:8080/adduser - add user and return id added user

BODY

{
    "name" : "Evgen",
    "reg_date" : "07-06-2022",
    "log_time" : "07-06-2022 19:25",
    "in_sys" : true,
    "role_id" : 2,
    "email" : "test@test.com",
    "password" : "1234"
}

POST http://127.0.0.2:8080/auth - login in system. Return access_token.

BODY

{
    "login_email" : "Evgen",
    "password" : "1234"
}

POST http://127.0.0.2:8080/updateuser - update name user by access_token

BODY

{
    "name" : "Other name"
}

POST http://127.0.0.2:8080/deleteuser - delete user by id

BODY

{
    "id" : 10
}