Login Request - HomamAlamier/UniversityWebProject GitHub Wiki

Login:
send a POST request to the link [WebsiteURL]/mobile/api/json/login containing the following content as JSON :

{
   "email": "[email]",
   "password": "[password]",
   "devicename": "[devicename]"
}

if the request success you will receive user data with a token to use. as an example if we send this JSON :
{
   "email": "[email protected]", 
   "password": "adminowner123", 
   "devicename": "testDevice"
}

we will receive:
{
   "Username":"Owner",
   "CreatedAt":"2021-05-15 10:23:51",
   "Email":"[email protected]",
   "Lastlogin":"2021-05-15 10:23:51",
   "token":"S4sKkssJOUSf5uVBzfXpmBeKCpIEjotW" <---- Auth Token
}

To get profile info send a POST request to the link [WebsiteURL]/mobile/api/json/me containing the following content as JSON :

{
   "token": "[Auth Token]"
}

an example we use the token received from the above example :

{
   "token": "S4sKkssJOUSf5uVBzfXpmBeKCpIEjotW"
}

the response will be :

{
   "Username":"Owner",
   "CreatedAt":"2021-05-15 10:23:51",
   "Email":"[email protected]",
   "Lastlogin":"2021-05-15 10:23:51"
}
⚠️ **GitHub.com Fallback** ⚠️