Labadee - Events API takes its name from a port/beach located on the northern coast of Haiti.
I started this small project while I was visiting this beautiful beach in Haiti, I got inspired by the warm blue waters, the hundreds of events and tours near the beach and of course by the friendly people from the flea markets.
Current version: v1
- GET /users Not available yet
- GET /users/:id Not available yet
- POST /users
- POST /sign_in
- GET /events/:event_id/attendees
- GET /events/:event_id/attendees/:id
- POST /events/:event_id/attendees
Make sure you have MongoDB installed and running on your computer (or server).
-
Clone the repo.
git clone https://github.com/mcka1n/labadee-api.git
-
bundle install
. -
run
rake db:seed
in order to 'install' the default values for users and clients. -
rake db:mongoid:create_indexes
-
rails s
I'm using a simple way to authenticate Clients (other apps or scripts) and Users.
For testing and debugging purposes you can run the seeds to create a default client, this will give you a client key which is required in every call to the API.
As a developer you have to send this client key
as a get param on every request you make, no exceptions.
Each and every user will have a token
field, this token contains a value used for authentication. Every time you sign in with email & password, the token will be refreshed and a new one will be returned.
As a developer you have to send as query params both client key
and user's token
on each request, except:
- Sign in
- Sign up
POST http://localhost:3000/v1/users/sign_in?key=Bnb@fUCodG_j-ywdnty
Params:
{
"user": {
"email": "[email protected]",
"password": "1234%678P"
}
}
Response:
Status: 200 OK
{
"success": true,
"auth_token": "W00tszBmuqdw4tsPY_rY",
"email": "[email protected]"
}