jtkaufman737 / CMSC-495

UMGC Capstone project for software engineering degree
MIT License
0 stars 1 forks source link

API endpoint structure #8

Open jtkaufman737 opened 2 years ago

jtkaufman737 commented 2 years ago
  1. (Joy) endpoint that takes POST requests to make a board - would get a name, description /api/boards. Request JSON would look like the following:
    { 
      "title": xxx, 
      "description": xxx
    }
  2. (Joy) endpoint that takes POST requests to add events/gates/transfers - would get a name, description, type, /api/symbols with data sent in the following format:
    { 
      "title": xxx,
      "description": xxx,
      "type": xxx, 
      "connections": [4,8]
    }
  3. stretch goal endpoint that takes DELETE requests to get rid of a node, /api/symbols/1
  4. stretch goal endpoint that takes DELETE requests to get rid of a board, /api/boards/1
  5. (Erick) endpoint that GETS symbols given a board id, /api/symbols?board_id=1, it would be ideal for it to send JSON in the following format:
    {  
    "status_code": 200, 
    "status_message": "success",
    "data": [ 
      { 
          "id": xxx,
          "type": xxx,
          "description": xxx 
          "title": xxx 
          "connections": [3,4] // connections is a list of IDs of other symbols 
       },
    ]
    }

    If no parameters are supplied in the request, it would return all symbols

  6. (Briar) Endpoint that GETS all boards /api/boards, returns data in the following format
    
    "status_code": 200, 
    "status_message": "success",
    "data": [ 
      { 
          "id": xxx,
          "description": xxx 
          "title": xxx 
       },
       { 
          "id": xxx,
          "description": xxx 
          "title": xxx 
       },
    ]
    }```
jtkaufman737 commented 2 years ago

The basics of accomplishing this in flask can be explored here https://flask.palletsprojects.com/en/2.0.x/quickstart/