Buclist is a simple bucketlist API allows consumers to perform CRUD operations on bucketlists. On those bucketlists, a user can further add items and perform CRUD operations on them too. This site has sample bucketlist and ideas you could borrow from.
Documentation - bucki-t.herokuapp.com.
Source code - github.com/andela-hmasila/buclist.
- User authentication with JWT.
- User can perform CRUD operations on Buckelist and Item resources
- API accepts paginated requests with page and limit e.g.
/bucketlists?limit=10&page=1
- API accepts queried requests on bucketlists eg
/bucketlists?q=sky
- API uses Accept header to version api calls e.g.
Accept:application/vnd.buclist.v1+json
. - API Blueprint documentation
1. git clone https://github.com/andela-hmasila/buclist.git
2. cd buclist
3. bundle install
4. rails db:setup
5. rails server
1. cd buclist
2. rspec
All endpoints except /signup
and /auth/login
require a token for Authorization
, failure to which the API will return the error.
{
"message": "Missing token"
}
An Authorization
token looks like this
{
auth_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE0Njc2MTkxNDV9.R6VLZD4qtsdVHXZwU8bEo6S16cbNQfo7lICsNdAq00I"
}
EndPoint | Functionality |
---|---|
POST /signup | Signup a user |
POST /auth/login | Login user |
GET /auth/logout | Logout user |
POST /bucketlists/ | Create a new bucket list |
GET /bucketlists/ | List all the created bucket lists |
GET /bucketlists?page=1&limit=5 | List five bucketlists from page 1 |
GET /bucketlists?q=bucket | Search for bucketlist |
GET /bucketlists/:id | Get single bucket list |
PUT /bucketlists/:id | Update this bucketlist |
DELETE /bucketlists/:id | Delete this single bucketlist |
POST /bucketlists/:id/items/ | Create a new item in bucketlist |
PUT /bucketlists/:id/items/:item_id | Update a bucketlist item |
DELETE /bucketlists/:id/items/:item_id | Delete an item in a bucket lists |
Request GET /bucketlists?page=1&limit=2
http https://bucki-t.herokuapp.com/bucketlists?page=2&limit=2 \
Authorization: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE0Njc2MTkxNDV9.R6VLZD4qtsdVHXZwU8bEo6S16cbNQfo7lICsNdAq00I'
Response (application/json)
[
{
"id": 1,
"name": "Resurrect from The Empire Strikes",
"items": [
{
"id": 9,
"name": "shoot Greedo",
"date_created": "2016-11-13 3:15:16",
"date_modified": "2016-11-13 3:15:16",
"done": false
}
],
"date_created": "2016-11-13 3:13:50",
"date_modified": "2016-11-13 3:13:50",
"created_by": "Han Solo"
},
{
"id": 2,
"name": "Find R2-D2",
"items": [
{
"id": 9,
"name": "Talk to C3PO",
"date_created": "2016-11-13 3:15:16",
"date_modified": "2016-11-13 3:15:16",
"done": false
}
],
"date_created": "2016-11-13 3:13:50",
"date_modified": "2016-11-13 3:13:50",
"created_by": "Luke Skywalker"
}
]
- The API only responds with JSON
- Fork it! 🍴
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git add -A && git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE.md file for details