Skip to content
jorge-d edited this page Feb 4, 2013 · 3 revisions

Basic commands

  • Launch test suite: rake cucumber:ok
  • Launch the server: rails s -p 3001 (I'll use the port 3001 in all my examples)
  • Populate the database:
rake db:seed

Note: (This will generate a member for each one of you, see db/seeds.rb)

Authentication

Note: all the request through the API need an authentication token.

You must send a POST /users/sign_in with the correct parameters (email and password) to receive your auth_token.

Example:

curl -X POST \
   -H "Accept: application/json" \
   -d 'user[email]=dimitri@yopmail.fr&user[password]=toto42' \
    http://localhost:3001/users/sign_in

Will have the following output:

{
  "response": "ok",
  "nickname": "keny",
  "first_name": "Dimitri",
  "last_name": "Jorge",
  "auth_token": "sYcyvuHUopjT46iMhkU5"
}

You MUST use the 'auth_token' returned in all the future requests !

Clone this wiki locally