Authorize API
Does not require Authentication
This API is used to authorize user upon user login.
URL
api/users/authorize
Required parameter
- username
- password
- deviceID
- notificationCenterType «contains user notification center. Content must be one of "apple", "android", "blackberry", "windows", "none"»
Optional parameter
- buildVersion «contains user application build version for notification. Content must be one of "DEV" or "PROD". Default will be: "PROD"»
- notifToken «user device notification token»
- timezoneOffset «better to pass this. Explanation see note at the bottom of this page»
- timezoneName «better to pass this. Explanation see note at the bottom of this page»
- deviceType «contains device user-agent»
- appVersion «contain application version that user use»
- OSVersion «contain OS version that user use»
- hierarchylogin «contain boolean whether it is login for hierarchylogin or not. If true, password given must already been encrypted.»
Example JSON Payload
{
"username": "support@superfy.com",
"password": "SupportMe",
"notificationCenterType": "apple",
"deviceType": "iPad",
"appVersion": "SmartSensor 1.0.0",
"OSVersion": "iOS 9.2.0",
"deviceID": "ABCD-EFGH-IJKL-MNOP",
"notifToken": "abcdefgh13234123423",
"timezoneOffset": 420,
"timezoneName": "Asia/Jakarta",
"buildVersion": "DEV",
"hierarchylogin": false
}
Possible return HTTP status code
- 200
- 400
- 405
Return message
{
"status": "success",
"message": {
"profile": {
"userID": 198,
"username": "support@superfy.com",
"firstName": "Support",
"lastName": "",
"phone": "",
"mobile": "+62822997572606",
"profilePicture": "https://wasteinsights-public-files.s3.ap-southeast-2.amazonaws.com/images/icon_placeholder_logo_individu.jpg",
"companyID": 0,
"departmentID": 0,
"createdDate": 1563937240,
"isAdmin": "Y",
"active": "Y",
"timezoneOffset": 420,
"timezoneName": "Asia/Jakarta",
"isEmailVerified": "Y",
"welcomepopup": "Y",
"isDemo": "N",
"acceptEula": "Y",
"acceptEulaDate": "1677031227",
"acceptEulaVer": null
},
"company": null,
"deviceID": "ABCD-EFGH-IJKL-MNOP",
"token": "895dbfbcc3deb395bb39d6451b24c1d5",
"lastActivityTime": "1692253718",
"server_timezoneOffset": 600
}
}
Note:
"server_timezoneOffset" contains server time differences to UTC in minutes. For example, if it is 600, it means that it is UTC +10 hour (600 minutes / 60 minutes × 1 hour = 10 hour)
"timezoneOffset" contains user time differences to UTC in minutes. For example, if it is 420, it means that it is UTC +7 hour (420 minutes / 60 minutes × 1 hour = 7 hour)
"timezoneName" contains user timezone name as mentioned in http://php.net/manual/en/timezones.php