Welcome to the GuestbookAPI project. This project is a challenge proposed by Try-Catch. GuestbookAPI exposes a Rest API enabling users to create events and its guests. The following features are available:
- Create users and assign roles like Admin or Guest
- Guests can read an event guestbook information.
- Admin can create, edit and remove events and its guestbook.
- Create, edit and remove events and assing guests to its guestbook.
The current version of the API is v1. All calls should be pointing to /api/v1/
Below is described the documentation to interact with User entity.
Following you can see the details on how to list of Users.
- Who can call: User admin
- URL: http://api.:3000/v1/users
- Method: GET
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload:
Following you can see the details on how to create a new User. Note that you will receive the token when you create your user.
- Who can call: Everyone
- URL: http://api.:3000/v1/users
- Method: POST
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload: {"user": {"name": "User_AAA", "email": "[email protected]", "password": "sss", "admin": true}}
Following you can see the details on how to update a User.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/users/<USER_ID>
- Method: PATCH
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload: {"user": {"name": "User_AAA", "email": "[email protected]", "password": "sss", "admin": false}}
Following you can see the details on how to show a User.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/users/<USER_ID>
- Method: GET
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload:
Following you can see the details on how to destroy a User.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/users/<USER_ID>
- Method: DELETE
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload:
Below is described the documentation to interact with Event entity.
Following you can see the details on how to list of Events.
- Who can call: Everyone
- URL: http://api.:3000/v1/events
- Method: GET
- Header:
- Payload:
Following you can see the details on how to create a new Event.
- Who can call: User
- URL: http://api.:3000/v1/events
- Method: POST
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload: {"event": {"name": "Event_AAAp", "date": "04/12/2016"}}
Following you can see the details on how to create a Event.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/events/<EVENT_ID>
- Method: PATCH
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload: {"event": {"name": "Event_AAAp", "date": "04/12/2016"}}
Following you can see the details on how to create a Event.
- Who can call: Everyone
- URL: http://api.:3000/v1/events
- Method: GET
- Header:
- Payload:
Following you can see the details on how to create a Event.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/events/<EVENT_ID>
- Method: DELETE
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload:
Below is described the documentation to interact with Guest entity.
Following you can see the details on how to create of Guests.
- Who can call: Everyone
- URL: http://api.:3000/v1/guests
- Method: GET
- Header:
- Payload:
Following you can see the details on how to create a new Guest.
- Who can call: User (Event owner)
- URL: http://api.:3000/v1/guests
- Method: POST
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload: {"guest": {"name": "Event_AAAp", "event_id": 1}}
Following you can see the details on how to create a Guest.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/guests/<GUEST_ID>
- Method: PATCH
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload: {"guest": {"name": "Event_AAAp", "event_id": 1}}
Following you can see the details on how to create a Guest.
- Who can call: Everyone
- URL: http://api.:3000/v1/guests/<GUEST_ID>
- Method: GET
- Header:
- Payload:
Following you can see the details on how to create a Guest.
- Who can call: Admin and User (Owner)
- URL: http://api.:3000/v1/guests/<GUEST_ID>
- Method: DELETE
- Header: Content-Type: application/json X-Token: USER_TOKEN
- Payload:
GuestbookAPI uses the follwowing technologies:
- RubyOnRails - Ruby - Web Framework!
GuestbookAPI requires [Ruby On Rails] v4.1.8 to run.
$ git clone [git-repo-url] challlenge_tc
$ cd challlenge_tc
$ rails s
- Deploy using Docker containers
- Add a CI/CD pipeline
- Hide the api_token from logs
- API to set User as Admin
- API to regenerate api_tokens
This is free :)