Politico API(ADC CHALLENGE 2)
- The API can create a political office
- The API can get all political offices
- The API can get a specific political office.
- The API can get all political parties.
- The API can get a specific political party.
- The API can edit name of a specific political party.
- The API can delete a particular political party.
- The API can create a political party.
-
Clone the repository
HERE -
Open terminal application on your local machine
-
On the terminal, run
git clone https://github.com/Egunza-dev/ch2api.gitcommand
$ cd ch2api
- Create and activate virtual environment
$ virtualenv api-env
$ source .env
- Install project dependencies
$ pip install -r requirements.txt
$ flask run
$ pytest
| Method | Endpoint | Functionality |
|---|---|---|
POST |
/api/v1/offices |
Create a political office |
GET |
/api/v1/offices |
Get all political offices |
GET |
/api/v1/offices/int:office-id |
Get a specific political party |
| Method | Endpoint | Functionality |
|---|---|---|
POST |
/api/v1/parties |
Create a political party |
GET |
/api/v1/parties |
Get all political parties |
GET |
/api/v1/parties/int:party-id |
Get a specific political party |
PATCH |
/api/v1/parties/int:party-id/name |
Edit name of a political party |
DELETE |
/api/v1/parties/int:party-id |
Delete a particular political party |