Skip to content

Commit

Permalink
Updates README with API endpoints and adds ASSESSMENT document to repo
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacRF committed Oct 23, 2020
1 parent a848b46 commit 2f053c1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Binary file added ASSESSMENT.docx
Binary file not shown.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,29 @@ Output is located in *./build*
npm run tsc
```

### Example calls
--- TODO: Postman examples
### Sample calls
You can test the API importing the [API sample calls collection](https://github.com/IsaacRF/streamcards-api/blob/main/call-examples/streamcards-api.postman_collection.json) to **Postman**. This collection contains sample data and required arguments for every route.

### Endpoints
All endpoints and detailed parameters are documented [here](https://documenter.getpostman.com/view/11626220/TVYDeKbL)

API default route is http://localhost:3000/api

- Create Card -> [***POST***] http://localhost:3000/api/cards
- Get Card by ID -> [***GET***] http://localhost:3000/api/cards/-cardID-
- Get Cards by Owner -> [***GET***] http://localhost:3000/api/cards/owner/-ownerID-
- Params
- cardsPerPage = -Defaults to 10-
- lastCardId = Used for pagination. First page if null
- Update Card Info -> [***PUT***] http://localhost:3000/api/cards
- Delete Card -> [***DELETE***] http://localhost:3000/api/cards
- Bulk Publish Cards -> [***PATCH***] http://localhost:3000/api/cards/publish
- Bulk Unpublish Cards -> [***PATCH***] http://localhost:3000/api/cards/unpublish

This JWT token can be used for auth (Auth = Bearer Token):
```
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1ZjhkYjI2YTRhNjYyOTU3OTk1NjAxODIiLCJuYW1lIjoiVGVzdCAxIn0.6pUeKaVtL-4k5Y8E7BsnN3t2C_GYCXe5zChA4ez5DDc
```

## TODO
- [ ] API needs a SignIn endpoint to generate the jwt auth token
Expand Down

0 comments on commit 2f053c1

Please sign in to comment.