Buckyy is a simple bucketlist API allowing consumers to perform CRUD operations on bucketlists. A user can have many bucketlists and each bucketlist can have many items.
- Getting Started
- Dependencies
- Tests
- API Endpoints
- Responses
- Error handling
- Versions
- Request & Response Examples
- Contributing
- Apiary Documentation
- User authentication with JWT.
- User can perform CRUD operations on Buckelist and items resources
- API accepts paginated requests with limit e.g.
curl -i http://buckyy.herokuapp.com/bucketlists?limit=5&page=2
- API uses Accept header to version api calls e.g.
Accept:application/vnd.buckyy.v1+json
. - Apiary documentation for easier integration
git clone https://github.com/andela-akabiru/buckyy.git
cd buckyy
bundle install
rake db:setup
rails server
The above will get you a copy of the project up and running on your local machine for development and testing purposes.
1. cd buckyy
2. bundle exec rake
All endpoints except /signup
require a token for authentication. The API call should have the token in Authorization header.
http http://buckyy.herokuapp.com/bucketlists \
Authorization: "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 |
The API responds with JSON data by default.
The API responds with an error message and http status code whenenever it encounters an error.
{
"error": "Not Found",
"status": "404"
}
The API uses Accept header to version api calls e.g. Accept:application/vnd.buckyy.v1+json
.
No breaking changes. 😃
Request GET /bucketlists?page=2&limit=2
http https://buckyy.herokuapp.com/bucketlists?page=2&limit=2 \
Authorization: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE0Njc2MTkxNDV9.R6VLZD4qtsdVHXZwU8bEo6S16cbNQfo7lICsNdAq00I'
Response (application/json)
[
{
"created_by": "1",
"id": 3,
"items": [
{
"bucketlist_id": 3,
"done": false,
"id": 3,
"name": "Obi-Wan Kenobi",
"date_created": "2016-07-04 5:16:12",
"date_modified": "2016-07-04 5:16:12",
}
],
"name": "eaque"
},
{
"created_by": "1",
"id": 4,
"items": [
{
"bucketlist_id": 4,
"done": false,
"id": 4,
"name": "Chewbacca",
"date_created": "2016-07-04 5:16:12",
"date_modified": "2016-07-04 5:16:12",
}
],
"name": "non"
}
]
- 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