Login Documentation

AjuroProductCard
Developed by Tom Ormiston and Cumpanasu Florin for aju.ro resoueces
(the romanian open market API).
Login Request
  {
      "user_action":"user_action_login",
      "email":"office@aju.ro",
      "password":"hashed_password"
  }
  
Logout Request JSON
  {
      user_action: "user_action_logout"
  }
  
Password Recovery Request
  {
      "user_action":"user_action_recover_password",
      "email":"office@aju.ro",
  }
  
New User Registration Request
  {
      "user_action":"user_action_register",
      "email":"office@aju.ro",
      "password":"hashed_password"
  }
  


In server response contain the request options, the sql query, the array of results and the status.
In case of an unsuccessful login, "result": null and "status"."success" = false, "status"."code" = "stay" and "status"."message" = "Wrong username or password!" In case of a successful login, one record will be returned as result. The status will be: "success": true
The code retourned by the endpoint will guide the client to deiplay the appropiate mask.
Login Response Example
  {
      "request": {
          "type": "user",
          "whereCondition": " WHERE `password` = 'hashed_password' ",
          "skip": 0,
          "distinct": null,
          "take": 100
      },
      "sql": {
          "query": "SELECT * FROM user  WHERE `password` = 'hashed_password' ORDER BY `timestamp` DESC LIMIT 100  OFFSET 0"
      },
      "result": [
          {
              "id": 22,
              "username": "start"
          }
      ],
      "status": {
          "success": true,
          "code": "logout",
          "message": "Welcome start"
      }
  }