Skip to content
This repository has been archived by the owner on Jul 4, 2020. It is now read-only.

SE17GroupH/ZapServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZapServer

This is the server side(implemented in Rails) of Zap, a project of Group H for 2017 CSC 510 Software Engineering course. It communicates via REST APIs with the android application Zap that showcases different authentication methods.

Documentation for API use:

User register:

  • Method: POST

  • Api location: https://zapserver.herokuapp.com/api/users/

  • Content-Type: application/json

  • Accept: application/vnd.zapserver.v1

  • JSON:

    {
    	"user": {
    		"email": "test@zapserver.com",
    		"password": "12345678",
    		"password_confirmation": "12345678"
    	}
    }
  • cURL example:

    curl -k -v -H "Content-Type:application/json" -X POST -d '{"user":{"email":"test@zapserver.com","password":"12345678", "password_confirmation":"12345678"}}' https://zapserver.herokuapp.com/api/users/

User log in:

  • Method: POST

  • Api location: https://zapserver.herokuapp.com/api/sessions

  • Content-Type: application/json

  • Accept: application/vnd.zapserver.v1

  • JSON:

    {
    	"session": {
    		"email": "example@zapserver.com",
    		"password": "12345678"
    	}
    }
  • cURL example:

curl -k -v -H "Content-Type:application/json" -X POST -d '{"session":{"password":"12345678","email":"example@zapserver.com"}}' https://zapserver.herokuapp.com/api/sessions/

User log out:

Magic link login

  • METHOD: POST

  • Api location: https://zapserver.herokuapp.com/api/magiclinks

  • Content-Type: application/json

  • Accept: application/vnd.zapserver.v1

  • cURL example:

    curl -k -v -H "Content-Type:application/json" -X POST -d '{"magiclink":{"email":"example@zapserver.com"}}' https://zapserver.herokuapp.com/api/magiclinks/

Verify user's auth_token

  • METHOD: POST

  • Api location: https://zapserver.herokuapp.com/api/check_auth_tokens

  • Content-Type: application/json

  • Accept: application/vnd.zapserver.v1

  • cURL exmaple:

    curl -k -v -H "Content-Type:application/json" -X POST -d '{"authorization":{"email":"example@zapserver.com","auth_token":"_xxBCxyscYqefVrRqrkT"}}' https://zapserver.herokuapp.com/api/check_auth_tokens/