Login
This API is used to authenticate user to the system. User invokes this API to login to the system.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/login
HTTP Request Header: Content-Type: application/json
HTTP Request Body: {
"username":"[Name]",
"password":"[Password]",
"system_id":"[System ID from IAM2]",
"system_secret":"[System secret code]"
}
HTTP Response Body: {
"accessToken": "5T_e-GoXlHd_xUIh7ot31_x2g-tihld7_f4t_mvSwgE=" // the IAM accessToken
}
This API is used to retrieve all roles and objects associated to a user permission. The response for this lists all the available roles and objects that are accessible by the user.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/perms/{accessToken}
HTTP Method: GET
HTTP Request Header: n/a
HTTP Request Body: n/a
HTTP Response Body: {
"Permission": {
"role": [
{
"role_id": -2,
"role_name": "user",
"role_desc": null,
"parent_role": null,
"system_id": -99
}
],
"objectAccesses": [
{
"object_id": -9,
"object_name": "USER_PROFILE_USERMODE",
"object_type": "MENU_USER",
"object_ref_id": null,
"access": [
{
"access_id": 1,
"access_type": "view",
"object_id": -9
}
],
"object_property": [
{
"objectPropertyId": -9,
"objectId": -9,
"name": "profileusermode",
"value": "/profileusermode.html"
}
]
}]
}}
This API is used to retrieve all user information regarding the logged in user.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/userinfo/{accessToken}
HTTP Method: GET
HTTP Request Header: n/a
HTTP Request Body: n/a
HTTP Response Body: {
"User_info": {
"username": "[Username]",
"th_firstname": "[TH FirstName]",
"th_lastname": "[TH LastName]",
"en_firstname": "[EN FirstName]",
"en_lastname": "[EN LastName]",
"position": "[Position]",
"department": "[Department]",
"email": "[Email]",
"phone": "[Phone number]",
"phone_ext": null,
"mobile": "[Mobile number]",
"avatar": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGIAAABiCAYAAACrpQYOAAAGTElEQVR42u2Ze2xURRTGeSj4ApGIMQYUEY3xD2Oif5ioJAgaEzWRBImoiY/E+EoMRaQCAgIVlEBIS6kGw0sQEQQfEK2C0N2WdktL2WoflHZ5dCu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szXG00RSoHDaJOghm7OF+0B3qUwxw1zZedrDcV1hvjIGl3y3IR==" // image as base64 encoded
}
}
This API is used to retrieve all objects accessible to the logged in user.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/objects?search=admin&sort=object_id,asc&page=0&size=10
HTTP Method: GET
HTTP Request Header: Content-Type: application/json, IAMToken: {accessToken}
HTTP Request Body: n/a
HTTP Response Body: {
"content":[{ "object_id":-14,
"object_name":"SETTING",
"object_type_id":-1,
"object_type_name":null,
"system_id":-99,
"update_date":null,
"update_by":-1,
"create_date":1528178394000,
"create_by":-1,
"system_name":null,
"object_type_desc":null,
"object_permission_id":0,
"access_type":null,
"path":"/SETTING",
"object_ref_id":"SETTING",
"objectAccess":null,
"objectProperty":null,
"protect":"Y"}],
"totalElements":27,
"totalPages":3,
"firstPage":true,
"lastPage":false,
"sort":[{"direction":"ASC","property":"object_id","ascending":true}],"numberOfElements":10,"size":10,"number":0}
This API is used to retrieve all objects types accessible to the logged in user.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/objectTypes
HTTP Method: GET
HTTP Request Header: Content-Type: application/json, IAMToken: {accessToken}
HTTP Request Body: n/a
HTTP Response Body: {
"content": [
{
"object_type_id": -2,
"object_type_name": "MENU_USER",
"object_type_desc": "Menu User",
"update_date": null,
"update_by": 0,
"create_date": null,
"create_by": 0,
"is_custom": "N",
"protect": "Y"
}
],
"totalElements": 14,
"totalPages": 1,
"firstPage": true,
"lastPage": true,
"sort": null,
"numberOfElements": 14,
"size": 50,
"number": 0
}
This API is used to retrieve all permissions from all the systems accessible to the logged in user.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/permissions?page=0&size=2
HTTP Method: GET
HTTP Request Header: Content-Type: application/json, IAMToken: {accessToken}
HTTP Request Body: n/a
HTTP Response Body: {
"content": [
{"permission_id":96,
"system_id":90,
"permission_name":"develop",
"parent_permission_id":0,
"update_date":null,
"update_by":0,
"create_date":1566533471000,
"create_by":107,
"path":"/develop",
"parent_permission_name":null}
],
"totalElements":154,
"totalPages":77,
"firstPage":true,
"lastPage":false,
"sort":null,
"numberOfElements":2,
"size":2,
"number":0}
This API is used to retrieve all users from all the systems.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/users
HTTP Method: GET
HTTP Request Header: Content-Type: application/json, IAMToken: {accessToken}
HTTP Request Body: n/a
HTTP Response Body: {
"content": [
{
"id": [User ID],
"username": "[Username]",
"fname": "[User first name]",
"lname": "[User Last name]"
}
],
"totalElements": 27,
"totalPages": 1,
"firstPage": true,
"lastPage": true,
"sort": null,
"numberOfElements": 27,
"size": 50,
"number": 0
}
This API is used to logout from the system.
URL: http://[SERVER]:[PORT]/IAM2RESTService/services/v1/logout/{accessToken}
HTTP Method: GET
HTTP Request Header: n/a
HTTP Request Body: n/a
HTTP Response Body: SUCCESS