You can use LogicMonitor REST API v3 to get user details. You must authenticate yourself before making the API request.

Getting List of Users

By default, a list of 50 users is returned. You can include the following query parameters to control the kind of data to include in the response and how it is formatted.

Note: The query parameters are not part of the resource path and should not be included while calculating the LMv1 authentication signature.

URI: GET /setting/admins

ParameterTypeDescription
typeStringThis query parameter is used to filter users with bearer tokens.
Example – url/setting/admins?type=bearer
permissionStringThis query parameter is used to filter users with traces permission.
Example – url/setting/admins?permission=traces
filterGroupStringStringThis parameter is used to match the following filter values with multiple fields.
* Admin firstName
* Admin lastName
* Admin userName
* roleName assigned to Admin
* Admin groupName
* Admin status

For example – url/setting/admins?filterGroupString=John

Here, the value John is matched against all the above fields.
fieldsStringThe response is filtered to include only the specified fields for each object. You can provide a list of properties separated by a comma.
Example – /setting/admins?fields=id,username
sizeIntegerThe number of results to display. A maximum of 1000 results can be requested in a GET call. By default, a list of 50 users is returned if a value is not provided for this parameter.
Example – /setting/admins?size=30
offsetIntegerThe number of result to offset the displayed result.
Example – /setting/admins?offset=20
filterStringThe response is filtered according to the operator and specified value that is, filter=property:value
  • Use an asterisk (*) to match more than one character
  • Use a dot (.) character to filter values within an object (example – custom properties)
  • Use a comma (,) to separate multiple filters
Operators include:
  • Greater than or equals >:
  • Less than or equals <:
  • Greater than >
  • Less than <
  • Equals :
  • Does not equal !:
  • Includes ~
  • Does not include !~

The following Python script gets all users in the account api.logicmonitor.com

#!/bin/env python
 
import requests
import json
import hashlib
import base64
import time
import hmac
import getpass
 
#Account Info: LogicMonitor recommends to NEVER hardcode the credentials. Instead, retrieve the values from a secure storage.
#Note: The below is provided for illustration purposes only.
AccessId = getpass.getpass("Enter your AccessId: ")
AccessKey = getpass.getpass("Enter your AccessKey: ")
Company = 'apiAccount'  
 
#Request Info
httpVerb ='GET'
resourcePath = '/setting/admins'
queryParams =''
data = ''
 
#Construct URL
url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath + queryParams
 
#Get current time in milliseconds
epoch = str(int(time.time() * 1000))
 
#Concatenate Request details
requestVars = httpVerb + epoch + data + resourcePath  
 
#Construct signature
digest = hmac.new(
        AccessKey.encode('utf-8'),
        msg=requestVars.encode('utf-8'),
        digestmod=hashlib.sha256).hexdigest()
signature = base64.b64encode(digest.encode('utf-8')).decode('utf-8')   
 
#Construct headers
auth = 'LMv1 ' + AccessId + ':' + str(signature) + ':' + epoch
headers = {'Content-Type':'application/json','Authorization':auth,'X-Version':3}
 
#Make request
response = requests.get(url, data=data, headers=headers)
 
#Print status and body of response
print('Response Status:',response.status_code)
print('Response Body:',response.content)
Python 3

Getting Details of a Specific User

URI: GET /setting/admins{ID}

ParameterTypeDescription
idInteger(Mandatory) The ID of the user whose details you want to get.
fieldsStringThe response is filtered to include only the specified fields for each object. You can provide a list of properties separated by a comma.
Example – /setting/admins/id?fields=username,role

The following Python script gets information about user 32 in account api.logicmonitor.com

#!/bin/env python
 
import requests
import json
import hashlib
import base64
import time
import hmac
import getpass
 
#Account Info: LogicMonitor recommends to NEVER hardcode the credentials. Instead, retrieve the values from a secure storage.
#Note: The below is provided for illustration purposes only.
AccessId = getpass.getpass("Enter your AccessId: ")
AccessKey = getpass.getpass("Enter your AccessKey: ")
Company = 'apiAccount'  
 
#Request Info
httpVerb ='GET'
resourcePath = '/setting/admins/32'
queryParams =''
data = ''
 
#Construct URL
url = 'https://'+ Company +'.logicmonitor.com/santaba/rest' + resourcePath + queryParams
 
#Get current time in milliseconds
epoch = str(int(time.time() * 1000))
 
#Concatenate Request details
requestVars = httpVerb + epoch + data + resourcePath  
 
#Construct signature
digest = hmac.new(
        AccessKey.encode('utf-8'),
        msg=requestVars.encode('utf-8'),
        digestmod=hashlib.sha256).hexdigest()
signature = base64.b64encode(digest.encode('utf-8')).decode('utf-8')   
 
#Construct headers
auth = 'LMv1 ' + AccessId + ':' + str(signature) + ':' + epoch
headers = {'Content-Type':'application/json','Authorization':auth,'X-Version':3}
 
#Make request
response = requests.get(url, data=data, headers=headers)
 
#Print status and body of response
print('Response Status:',response.status_code)
print('Response Body:',response.content)
Python 3