Skip to content

DB server API

Sofiia Tesliuk edited this page Feb 8, 2020 · 1 revision

Database server API

Action URL http://server_path Method
Create user /user_sign_up POST

Request

{
    "email": str, 
    "name": str, 
    "phone number": str, 
    "password": str 
}

Response

{
    "user_id": int 
}
Check user /user_check_password GET

Request

{
    "email": str, 
    "password": str
}

Response

{
    "user_id": int 
}
Get items /items GET

Request

{}

Response

{
    "categories": [{
                    "category_id": int, 
                    "name": str, 
                    "items_id": [int]
                   }]
    "items": {
               "item_id": str
             }
}
Get posts /posts GET

Request

{
    "city_id": int, 
    "time_from": str, 
    "time_to": str, 
    "categories_id": [int], 
    "items_id": [int]
}

Response

{
    "posts": [{
                "post_id": int, 
                "user_id": int, 
                "time_from": str, 
                "time_to": str, 
                "location_id": int,
                "description": str,
                "category_id": [int]
                "items_id": [int]
              }]
    "users": {
               "user_id": {
                            "name": str,
                            "phone_number": str
                          },
             }
    "locations": {
                   "location_id": {
                                    "region_id": int,
                                    "address": str,
                                    "longitude": double,
                                    "latitude": double
                                  }
                 }
    "regions": {
                 "region_id": {
                                "name": str
                              }
               }
}
Something wrong /* GET/PUT/POST

Request

{}

Response

{
    "error": str
}
Clone this wiki locally