Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
You can use LogicMonitor’s REST API to programmatically get a list of website groups or to get information about a particular website group.
Returns a list of website groups
HTTP Method:GET
URI: /service/groups
Request Parameters:
By default, 50 website groups will be returned. You can include sort, filter, fields, size, and offset parameters to control what data is included in the response and how it is formatted. Note that query parameters are not considered part of the resource path, and should not be included the calculation of the LMv1 authentication signature.
Operators include:
The following request returns a list of all website groups that exist in the api.logicmonitor.com account
Request:
curl --user 'apiUser:example' -X GET "https://api.logicmonitor.com/santaba/rest/service/groups"
Response:
{ "status" : 200, "errmsg" : "OK", "data" : { "total" : 5, "items" : [ { "id" : 1, "name" : "sarah", "description" : "", "disableAlerting" : false, "stopMonitoring" : false, "parentId" : 0, "alertStatus" : "unconfirmed-critical", "sdtStatus" : "none-none-none", "alertDisableStatus" : "none-none-disable", "hasServicesDisabled" : false, "numOfServices" : 13, "userPermission" : "write", "serviceProperties" : [ { "name" : "billing", "value" : "website" }, { "name" : "team", "value" : "TechOps" } ], "numOfDirectServices" : 3, "testLocation" : "{\"smgIds\":[2,3,4,5],\"all\":false}", "fullPath" : "", "subGroups" : [ { "id" : 12, "name" : "Production", "userPermission" : "write", "disableAlerting" : false, "stopMonitoring" : false, "hasServicesDisabled" : false, "numOfServices" : 4, "numOfDirectServices" : 4, "alertDisableStatus" : "none-none-none", "alertStatus" : "none", "sdtStatus" : "none-none-none", "fullPath" : "Production", "description" : "" }, { "id" : 14, "name" : "QA", "userPermission" : "write", "disableAlerting" : false, "stopMonitoring" : false, "hasServicesDisabled" : false, "numOfServices" : 4, "numOfDirectServices" : 4, "alertDisableStatus" : "none-none-none", "alertStatus" : "none", "sdtStatus" : "none-none-none", "fullPath" : "QA", "description" : "" } ] }, { "id" : 12, "name" : "Production", "description" : "", "disableAlerting" : false, "stopMonitoring" : false, "parentId" : 1, "alertStatus" : "none", "sdtStatus" : "none-none-none", "alertDisableStatus" : "none-none-none", "hasServicesDisabled" : false, "numOfServices" : 4, "userPermission" : "write", "serviceProperties" : [ { "name" : "username", "value" : "Bob" }, { "name" : "password", "value" : "password" } ], "numOfDirectServices" : 4, "testLocation" : "{\"all\":false,\"smgIds\":[1,2,3,4,5]}", "fullPath" : "Production", "subGroups" : [ ] }, { "id" : 14, "name" : "QA", "description" : "", "disableAlerting" : false, "stopMonitoring" : false, "parentId" : 1, "alertStatus" : "none", "sdtStatus" : "none-none-none", "alertDisableStatus" : "none-none-none", "hasServicesDisabled" : false, "numOfServices" : 4, "userPermission" : "write", "serviceProperties" : [ ], "numOfDirectServices" : 4, "testLocation" : "{\"all\":true}", "fullPath" : "QA", "subGroups" : [ { "id" : 15, "name" : "Tests", "userPermission" : "write", "disableAlerting" : false, "stopMonitoring" : false, "hasServicesDisabled" : false, "numOfServices" : 0, "numOfDirectServices" : 0, "alertDisableStatus" : "none-none-none", "alertStatus" : "none", "sdtStatus" : "none-none-none", "fullPath" : "QA/Tests", "description" : "" } ] }, { "id" : 15, "name" : "Tests", "description" : "", "disableAlerting" : false, "stopMonitoring" : false, "parentId" : 14, "alertStatus" : "none", "sdtStatus" : "none-none-none", "alertDisableStatus" : "none-none-none", "hasServicesDisabled" : false, "numOfServices" : 0, "userPermission" : "write", "serviceProperties" : [ ], "numOfDirectServices" : 0, "testLocation" : "{\"all\":true}", "fullPath" : "QA/Tests", "subGroups" : [ ] } ], "searchId" : null }
The following request returns the id, name, and stopMonitoring values for each of the website groups in api.logicmonitor.com, sorted in ascending order by the id,
curl --user 'apiUser:example' -X GET "https://api.logicmonitor.com/santaba/rest/service/services?fields=id,name,stopMonitoring&sort=+id"
{ "status" : 200, "errmsg" : "OK", "data" : { "total" : 8, "items" : [ { "id" : 22, "name" : "A_Record_Kittens_LB", "stopMonitoring" : false }, { "id" : 21, "name" : "CName_check", "stopMonitoring" : false },{ "id" : 31, "name" : "newsWebService", "stopMonitoring" : false }, { "id" : 34, "name" : "newWebService", "stopMonitoring" : false }, { "id" : 32, "name" : "pingService", "stopMonitoring" : false } ] }
Returns details for a particular website group
URI: /service/groups/{id}
The following request returns the details for the website group with id of 1 (the root group).
curl --user 'apiUser:example' -X GET "https://api.logicmonitor.com/santaba/rest/service/groups/1"
{ "status" : 200, "errmsg" : "OK", "data" : { "id" : 1, "name" : "sarah", "description" : "", "disableAlerting" : false, "stopMonitoring" : false, "parentId" : 0, "alertStatus" : "unconfirmed-critical", "sdtStatus" : "none-none-none", "alertDisableStatus" : "none-none-disable", "hasServicesDisabled" : false, "numOfServices" : 13, "userPermission" : "write", "serviceProperties" : [ { "name" : "billing", "value" : "website" }, { "name" : "team", "value" : "TechOps" } ], "numOfDirectServices" : 3, "testLocation" : "{\"smgIds\":[2,3,4,5],\"all\":false}", "fullPath" : "", "subGroups" : [ { "id" : 11, "name" : "Internal Services", "userPermission" : "write", "disableAlerting" : false, "stopMonitoring" : false, "hasServicesDisabled" : false, "numOfServices" : 2, "numOfDirectServices" : 2, "alertDisableStatus" : "none-none-none", "alertStatus" : "unconfirmed-critical", "sdtStatus" : "none-none-none", "fullPath" : "Internal Services", "description" : "" }, { "id" : 12, "name" : "Production", "userPermission" : "write", "disableAlerting" : false, "stopMonitoring" : false, "hasServicesDisabled" : false, "numOfServices" : 4, "numOfDirectServices" : 4, "alertDisableStatus" : "none-none-none", "alertStatus" : "none", "sdtStatus" : "none-none-none", "fullPath" : "Production", "description" : "" }, { "id" : 14, "name" : "QA", "userPermission" : "write", "disableAlerting" : false, "stopMonitoring" : false, "hasServicesDisabled" : false, "numOfServices" : 4, "numOfDirectServices" : 4, "alertDisableStatus" : "none-none-none", "alertStatus" : "none", "sdtStatus" : "none-none-none", "fullPath" : "QA", "description" : "" } ] }
The following request returns the id, name of, and number of websites within the group with id 1.
curl --user 'apiUser:example' -X GET "https://api.logicmonitor.com/santaba/rest/service/services/1?fields=id,name,numOfServices"
{ "status" : 200, "errmsg" : "OK", "data" : { "id" : 1, "name" : "sarah", "numOfServices" : 13 }
In This Article