Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/beterrabaa/codeleap_challenge
https://github.com/beterrabaa/codeleap_challenge
Last synced: 11 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/beterrabaa/codeleap_challenge
- Owner: beterrabaA
- Created: 2024-02-20T20:36:27.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-02-20T21:01:24.000Z (9 months ago)
- Last Synced: 2024-02-20T22:23:38.354Z (9 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Codeleap Challenge
API to manage users data
## Run locally
```bash
python3 -m venv env
source env/bin/activate
pip install djangorestframeworkcd api_codeleap
python .\manage.py runserver
```## Endpoints
#### List all users
```http
GET http://localhost:8000/user/
``````json
[
{
"id": 1,
"username": "leomaneiro",
"created_datetime": "2024-02-20T22:42:44.703253Z",
"title": "charmer",
"content": "content"
},
{
"id": 2,
"username": "leomaneiro2",
"created_datetime": "2024-02-20T22:56:57.057420Z",
"title": "unic",
"content": "content"
}
]
```#### Create a new user
```http
POST http://localhost:8000/user/
```Input
```json
{
"username": "leomaneiro3",
"title": "runner",
"content": "content"
},
```Output
```json
{
"id": 3,
"username": "leomaneiro3",
"created_datetime": "2024-02-20T22:56:57.057420Z",
"title": "runner",
"content": "content"
},
```#### Update user
```http
PATCH http://localhost:8000/user/${id}
```| Parâmetro | Tipo | Descrição |
| :-------- | :------- | :------------------------------------------ |
| `id` | `string` | **Obrigatório**. O ID do item que você quer |Input
```json
{
"title": "suspicious",
"content": "another content"
},
```Output
```json
{
"id": 3,
"username": "leomaneiro3",
"created_datetime": "2024-02-20T22:56:57.057420Z",
"title": "suspicious",
"content": "another content"
},
```#### Delete user
```http
DELETE http://localhost:8000/user/${id}
```| Parâmetro | Tipo | Descrição |
| :-------- | :------- | :------------------------------------------ |
| `id` | `string` | **Obrigatório**. O ID do item que você quer |Output
```json
{}
```