asims@cspire.com 3 Posted Thursday at 02:54 PM Share Posted Thursday at 02:54 PM I'm looking for a way to manage our user groups via the API. At the moment, I don't see a way to move a user between groups, add groups, or delete groups. This would especially come in handy in combination with the SSO login option. Most of our roles are automatically assigned when a user logs in. However, they will always land in the Ungrouped folder. If the User object returned the group the user belonged to, we could use the patch method to move the user to the group that matches their role. In another instance, we use a python script implemented as a config source that suspends users if they haven't logged in in 90 days. I have a "suspended" users group that I currently manually move those users to. We could implement the move automatically in the script if that piece of information was returned by the API. Returned user model: { "acceptEULA": true, "acceptEULAOn": 0, "apiTokens": [ { "accessId": "string", "accessKey": "string", "adminId": 0, "adminName": "string", "createdBy": "string", "createdOn": 0, "id": 0, "lastUsedOn": 0, "note": "John Doe's API Token", "roles": [ "string" ], "status": 2 } ], "apionly": false, "contactMethod": "email", "createdBy": "Chief Admin", "email": "john.doe@logicmonitor.com", "firstName": "John", "forcePasswordChange": true, "id": 0, "lastAction": "string", "lastActionOn": 0, "lastActionOnLocal": "string", "lastLoginOn": 0, "lastName": "Doe", "note": "John Doe is an Admin on this Portal", "password": "JohnDoe1", "phone": "8054445555", "roles": [ { "acctRequireTwoFA": true, "associatedUserCount": 0, "customHelpLabel": "Internal Support Resources", "customHelpURL": "https://logicmonitor.com/support", "description": "Administrator can do everything, including security-sensitive actions", "enableRemoteSessionInCompanyLevel": true, "id": 0, "name": "administrator", "privileges": [ { "objectId": "123", "objectName": "string", "objectType": "dashboard group", "operation": "write", "subOperation": "string" } ], "requireEULA": true, "twoFARequired": true } ], "smsEmail": "8054445555@logicmonitor.com", "smsEmailFormat": "sms", "status": "active", "timezone": "America/Los Angeles", "trainingEmail": "string", "twoFAEnabled": false, "username": "John", "viewPermission": "{\n\n\"Hosts\" : true,\n\"Services\" : true,\n\"Reports\" : true,\n\"Dashboards\" : true,\n\"Alerts\" : true,\n\"Settings\" : true\n}" } 1 Quote Link to post Share on other sites
Administrators Stuart Weenig 66 Posted Thursday at 04:55 PM Administrators Share Posted Thursday at 04:55 PM User group management doesn't exist in v2 of the API. You can try v3 of the API, which is completely undocumented, unpublished, and unsupported (but pretty easy to reverse engineer using developer tools in your browser). 2 Quote Link to post Share on other sites
Vitor Santos 72 Posted Monday at 01:28 PM Share Posted Monday at 01:28 PM Yeah @Stuart Weenig is right. We had this type of need in the past (doing some sort of user management) when automating some processes at our company. Unfortunately I no longer have the script 😞 But, this was accomplished on Python & exploring the API v3. What allowed me discover the calls I needed was performing the operation on the browser & then analyzing the calls/etc... with the dev. tools (F12 on Chrome for example). 2 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.