RPC API Developer's Guide

Get roles

Note that LogicMonitor does have an available REST API equivalent for this API call.

LogicMonitor's RPC API enables you to programmatically view details for the roles in your account with getRoles.

Note: As with all our API calls, authentication is required.

 

getRoles

URL:
https://accountName.logicmonitor.com/santaba/rpc/getRoles?c=accountName&u=username&p=password

 

All outputs will be in the format: { [status], [data], [errmsg] }, where status is the status of the response, errmsg is the error message associated with the response and the data object lists all roles.  The following information will be returned for each role:

  • id
  • description
  • name
  • privileges

 

Example

Request:
curl "https://apiAccount.logicmonitor.com/santaba/rpc/getRoles?c=apiAccount&u=apiUser&p=example" 
Response:
{
  "status": 200,
  "data": [
    {
      "id": 4,
      "customHelpURL": "",
      "description": "Able to view and acknowledge alerts for all hosts and services, but not make any other changes",
      "name": "ackonly",
      "customHelpLabel": "",
      "privileges": [
        {
          "id": 14,
          "operation": "ack",
          "objectByName": "host.*",
          "object": "host.*",
          "roleId": 4
        },
        {
          "id": 15,
          "operation": "write",
          "objectByName": "dashboard.private",
          "object": "dashboard.private",
          "roleId": 4
        },
        {
          "id": 16,
          "operation": "ack",
          "objectByName": "service.*",
          "object": "service.*",
          "roleId": 4
        },
        {
          "id": 20,
          "operation": "write",
          "objectByName": "deviceDashboard",
          "object": "deviceDashboard",
          "roleId": 4
        },
        {
          "id": 120,
          "operation": "read",
          "objectByName": "help.*",
          "object": "help.*",
          "roleId": 4
        }
      ]
    },.....
   ........
   ........
      {
      "id": 9,
      "customHelpURL": "",
      "description": "Permission to view XYZ Co. devices and dashboards",
      "name": "XYZ Co.",
      "customHelpLabel": "",
      "privileges": [
        {
          "id": 79,
          "operation": "read",
          "objectByName": "dashboard.Project Plan ",
          "object": "dashboard.39",
          "roleId": 9
        },
        {
          "id": 80,
          "operation": "read",
          "objectByName": "dashboard.XYZ Co.(folder)",
          "object": "dashboard.folder2",
          "roleId": 9
        },
        {
          "id": 81,
          "operation": "ack",
          "objectByName": "host.XYZ Co.",
          "object": "host.52",
          "roleId": 9
        },
        {
          "id": 82,
          "operation": "read",
          "objectByName": "setting.accesslog",
          "object": "setting.accesslog",
          "roleId": 9
        },
        {
          "id": 83,
          "operation": "read",
          "objectByName": "setting.accountinfo",
          "object": "setting.accountinfo",
          "roleId": 9
        },
        {
          "id": 84,
          "operation": "read",
          "objectByName": "setting.alert",
          "object": "setting.alert",
          "roleId": 9
        },
        {
          "id": 85,
          "operation": "read",
          "objectByName": "setting.collector.*",
          "object": "setting.collector.*",
          "roleId": 9
        },
        {
          "id": 86,
          "operation": "read",
          "objectByName": "setting.datasource.*",
          "object": "setting.datasource.*",
          "roleId": 9
        },
        {
          "id": 87,
          "operation": "read",
          "objectByName": "setting.integration",
          "object": "setting.integration",
          "roleId": 9
        },
        {
          "id": 88,
          "operation": "read",
          "objectByName": "setting.messagetemplate",
          "object": "setting.messagetemplate",
          "roleId": 9
        },
        {
          "id": 89,
          "operation": "read",
          "objectByName": "setting.userrole.*",
          "object": "setting.userrole.*",
          "roleId": 9
        },
        {
          "id": 90,
          "operation": "read",
          "objectByName": "chat",
          "object": "chat",
          "roleId": 9
        },
        {
          "id": 91,
          "operation": "write",
          "objectByName": "deviceDashboard",
          "object": "deviceDashboard",
          "roleId": 9
        },
        {
          "id": 124,
          "operation": "read",
          "objectByName": "help.*",
          "object": "help.*",
          "roleId": 9
        }
      ]
    }
  ],
  "errmsg": "OK"
}