RPC API Developer's Guide (Deprecated)

RPC API: Get Widgets

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

Dashboards can display a variety of different Widgets.  Widgets can contain device instance graphs, custom graphs, a filtered list of alerts, NOC tables and other types of content. LogicMonitor's RPC API enables you to view details for your existing widgets with the getWidgets, getDashboardWidgets and getWidget requests.

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

 

getWidgets

Get details for one or more widgets

URL:
https://accountName.logicmonitor.com/santaba/rpc/getWidgets?c=accountName&u=user&p=password&type=widgetType&edit=trueOrFalse 

 

Request Parameters: You can include the following as query parameters in an addWidget request:

Parameter

Type

Description

type String Optional. The type of widgets that you want to be returned. alert | cgraph (custom graph) | noc | ngraph (device instance graph) |
ograph (overview graph) | netflowgraph | netflow | batchjob | flash | gmap (google map)

 

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 includes an object for each widget, where the following data is returned for each widget:

  • id
  • description
  • columnIdx
  • lastUpdatedBy
  • name
  • ord
  • params
  • lastUpdatedOn
  • type
  • dashboardId

 

Example

Request:
curl "https://apiAccount.logicmonitor.com/santaba/rpc/getWidgets?c=apiAccount&u=apiUser&p=example&type=ngraph" 
Response:
{
  "status": 200,
  "data": [
    {
      "id": 263,
      "description": "",
      "columnIdx": 3,
      "lastUpdatedBy": "",
      "name": "172.31.36.125-CPU-Core Count: 1-Load",
      "ord": 2,
      "params": [
        {
          "name": "dsiid",
          "value": "2222"
        },
        {
          "name": "graphid",
          "value": "1753"
        },
        {
          "name": "hid",
          "value": "206"
        },
        {
          "name": "timescale",
          "value": "day"
        }
      ],
      "lastUpdatedOn": 1447871188,
      "type": "ngraph",
      "dashboardId": 38
    },......
    ........
    ........
    {
      "id": 226,
      "description": "",
      "columnIdx": 2,
      "lastUpdatedBy": "sarah",
      "name": "ip-172-31-37-162.us-west-2.compute.internal-Apache-Accesses",
      "ord": 1,
      "params": [
        {
          "name": "dsiid",
          "value": "852"
        },
        {
          "name": "graphid",
          "value": "270"
        },
        {
          "name": "hid",
          "value": "39"
        },
        {
          "name": "interval",
          "value": "5"
        },
        {
          "name": "timescale",
          "value": "1day"
        }
      ],
      "lastUpdatedOn": 1441822203,
      "type": "ngraph",
      "dashboardId": 32
    }
  ],
  "errmsg": "OK"
} 

 

getDashboardWidgets

Get details for the widgets belonging to a specific dashboard

URL:
https://accountName.logicmonitor.com/santaba/rpc/getDashboardWidgets?c=accountName&u=user&p=password&id=dashboardId 

 

Request Parameters: You can include the following as query parameters in an addWidget request:

Parameter

Type

Description

id Integer Required. The Id of the Dashboard whose widgets you want to return.

 

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 includes an object for each widget, where the following data is returned for each widget:

  • id
  • description
  • columnIdx
  • lastUpdatedBy
  • name
  • ord
  • params
  • lastUpdatedOn
  • type
  • dashboardId

 

Example

Request:
curl "https://apiAccount.logicmonitor.com/santaba/rpc/getDashboardWidgets?c=apiAccount&u=apiUser&p=example&id=37" 
Response:
{
  "status": 200,
  "data": [
    {
      "id": 260,
      "description": "",
      "columnIdx": 3,
      "lastUpdatedBy": "sarah",
      "name": "eculler01.us-east-1.logicmonitor.net-Mysql Global Stats-3306-Cache_Hit_Ratio",
      "ord": 1,
      "params": [
        {
          "name": "dsiid",
          "value": "2133"
        },
        {
          "name": "graphid",
          "value": "1039"
        },
        {
          "name": "hid",
          "value": "199"
        },
        {
          "name": "interval",
          "value": "5"
        },
        {
          "name": "timescale",
          "value": "7days"
        }
      ],
      "lastUpdatedOn": 1447280947,
      "type": "ngraph",
      "dashboardId": 37
    },......
    ........
    ........
    {
      "id": 209,
      "description": "",
      "columnIdx": 1,
      "lastUpdatedBy": "sarah",
      "name": "Top EC2 CPUs",
      "ord": 1,
      "params": [
        {
          "name": "graphid",
          "value": "95"
        },
        {
          "name": "interval",
          "value": "3"
        },
        {
          "name": "timescale",
          "value": "1day"
        }
      ],
      "lastUpdatedOn": 1442511898,
      "type": "cgraph",
      "dashboardId": 37
    }
  ],
  "errmsg": "OK"
} 

 

getWidget

Get details for one widget

URL:
https://accountName.logicmonitor.com/santaba/rpc/getWidget?c=accountName&u=user&p=password&widgetId=widgetId 

 

Request Parameters: You can include the following as query parameters in an addWidget request:

Parameter

Type

Description

widgetId Integer Required. The Id of the widget that you want to return. You can find this value in the widget configuration dialog in the new UI.

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 includes an object for each widget, where the following data is returned for each widget:

  • id
  • description
  • columnIdx
  • lastUpdatedBy
  • name
  • ord
  • params
  • lastUpdatedOn
  • type
  • dashboardId

 

Example

Request:
curl "https://apiAccount.logicmonitor.com/santaba/rpc/getWidget?c=apiAccount&u=apiUser&p=example&widgetId=212" 
Response:
{
  "status": 200,
  "data": {
    "sharableDashboard": true,
    "id": 212,
    "adminId": 0,
    "description": "",
    "columnIdx": 2,
    "lastUpdatedBy": "",
    "name": "Top EBS Provisioned IOPS Volume Throughput Percentages",
    "ord": 2,
    "params": [
      {
        "name": "graphid",
        "value": "98"
      },
      {
        "name": "interval",
        "value": "3"
      },
      {
        "name": "timescale",
        "value": "day"
      }
    ],
    "lastUpdatedOn": 1440609491,
    "type": "cgraph",
    "dashboardId": 37
  },
  "errmsg": "OK"
}