I.1 Users API - GruMP-y/FASTWS GitHub Wiki

Registration


Note : An email will be sent to the user regarding the new password if email notification is enabled. Otherwise, the password will be set to be the same with the EmployeeID.

Call Type :

POST

Sample Call :

http://[web address]/api/User/Registration

Body :

{
"EmployeeID" : 1111
}

Return :

  • Successful Registration

STATUS : 200 OK ; BODY : "SUCCESSFUL"

  • Not Successful. User is already registered.

STATUS : 200 OK ; BODY : "EXISTS"

Login


Call Type :

POST

Sample Call :

http://[web address]/api/User/Login

Body :

{
"EmployeeID": 1111,
"HashedPassword": "XXXXXXXXXXXXXXXX"
}

Note : The client must pass the hashed password. Use MD5.

Return:

  • Successful Login

STATUS : 200 OK ; BODY : "SUCCESSFUL"

  • Not Successful Login.

STATUS : 200 OK ; BODY : "NOT SUCCESSFUL"

  • User Not Found.

STATUS : 200 OK ; BODY : "NOT FOUND"

Change Password


Note : An email will be sent to the user regarding the new password if email notification is enabled. Otherwise, the password will be set to be the same with the EmployeeID.

Call Type :

PUT

Sample Call :

http://[web address]//api/User/ChangePassword

Body :

{
"EmployeeID": 1,
"HashedOldPassword": "XXXXXXXXXXXXXXXX",
"HashedNewPassword": "XXXXXXXXXXXXXXXX"
}

Note : The client must pass the hashed password. Use MD5.

Return :

  • Successful Login

STATUS : 200 OK ; BODY : "SUCCESSFUL"

  • Not Successful Login.

STATUS : 200 OK ; BODY : "NOT SUCCESSFUL"

Reset Password


Call Type :

PUT

Sample Call :

http://[web address]//api/User/ResetPassword

Body :

{
"EmployeeID": 1
}

Return :

  • Successful Login

STATUS : 200 OK ; BODY : "SUCCESSFUL"

  • Not Successful Login.

STATUS : 200 OK ; BODY : "NOT SUCCESSFUL"

Get Access Rights


This method will return the access rights assigned to the employee.

Call Type :

GET

Sample Call :

http://localhost:49418/api/User/Access/1111

Return :

[
{
"AccessLevel": 1,
"DepartmentID": 1
},
{
"AccessLevel": 1,
"DepartmentID": 2
}
]

Note : If the employee is not an administrator or a manager, the service will return NULL.