Metaservice RESTful API for building webapps, mobile apps, etc.
RESTful API Метасервиса для создания веб-приложений, мобильных приложений и т.д.
|
2 anni fa | |
---|---|---|
__pycache__ | 2 anni fa | |
rest_venv | 2 anni fa | |
README.md | 2 anni fa | |
api.py | 2 anni fa | |
config.py | 2 anni fa | |
connect.py | 2 anni fa | |
function.py | 2 anni fa |
cd C:/your_path/pythoRestApi/rest_api_venv/Scripts
activate.bat
, cd ../../
and python api.py
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"
}
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"
}
]
http://127.0.0.2:8080/adduser
- add user and return id added userBODY
{
"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"
}
http://127.0.0.2:8080/auth
- login in system. Return access_token.BODY
{
"login_email" : "Evgen",
"password" : "1234"
}
http://127.0.0.2:8080/updateuser
- update name user by access_tokenBODY
{
"name" : "Other name"
}
http://127.0.0.2:8080/deleteuser
- delete user by idBODY
{
"id" : 10
}