You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

The server ip-address:port is http://3.232.82.82:5000

URL/api/login/
DescriptionLogin a user, and set cookie for authentication
MethodPOST
Url Param 
Request Body Data
  1. HTML Form Submission with fields:
    1. email (string)
    2. password (string)
    3. remember_me (optional boolean)
  2. Alternatively, you can manually add following fields in request body as a json format:
    1. email (string)
    2. password (string)
    3. remember_me (optional boolean)
    4. formdata (empty string)
Response
  • {message: "Logged in."} - 200
  • {message: "Bad request format"} - 400
  • {message: "invalid credential(s) provided, please check your credential(s) and try again"} - 400/401
Cookie
  • session: a cookie for trace login status
  • remember_token: a cookie for remember_me feature (only when logged in with remember_me set to true)
URL/api/registration/
DescriptionRegister a new user.
MethodPOST
Url Param 
Request Body Data
  1. HTML Form Submission with fields:
    1. email (string)
    2. username (string)
    3. password (string)
    4. password2 (string)
  2. Alternatively, you can manually add following fields in request body as a json format:
    1. email (string)
    2. username (string)
    3. password (string)
    4. password2 (string)
    5. formdata (!EMPTY! string)
Response
  • {message: "Registered, please login."} - 200
  • {message: "Data input is not valid, please try again"} - 400
Cookie

 

URL/api/logout/
DescriptionLogout a user, set cookie/disable the token saved in cookie
MethodPOST
Url Param 
Request Body Data

 

Response
  • {message: "logged out"} - 200
Cookie
  • session: will be removed
  • remember_token: will be removed
  • No labels