RPC API Developer's Guide

Update a user

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

LogicMonitor's RPC API enables you to programmatically update the users in your account with updateAccount.

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

 

updateAccount

URL:
https://accountName.logicmonitor.com/santaba/rpc/updateAccount?c=accountName&u=Username&p=password&id=userId&username=accountToUpdate&password=password&roles=2&status=active&contactMethod=email&email=Example@logicmonitor.com&phone=8008132&viewPermission=%7B%22Dashboards%22%3Atrue%2C%22Hosts%22%3Atrue%2C%22Services%22%3Atrue%2C%22Alerts%22%3Atrue%2C%22Reports%22%3Atrue%2C%22Settings%22%3Atrue%7D

 

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

Parameter

Type

Description

id Integer Required. The id for the account you want to update.
username String Required. The username for the account.
password String Required. The password for the account.
roles Integer Required. The role(s) for the account, where multiple roles should be separated by commas. The default roles are:

1: Administrator
2: Read Only
4: Acknowledge Only

You can use the getRoles RPC to get all roles for your LogicMonitor account.

status String Required. active | suspended
contactMethod String Required. email | smsemail
email String Required if contactMethod=email. The email address for the user account.
smsemail String Required if contactMethod=smsemail. The smsemail address for the user account.
smsEmailFormat String Required if contactMethod=smsemail. sms | fulltext
viewPermission String Required. The view permissions for the new user account. This string must be URL encoded.

Decoded, the string should be in this format:
{"Dashboards":true,"Hosts":true,"Services":true,"Alerts":true,"Reports":true,"Settings":true,"OnlyNewUI":true}

URL encoded, the above string is:
%7B%22Dashboards%22%3Atrue%2C%22Hosts%22%3Atrue%2C%22Services%22%3Atrue%2C%22Alerts%22%3Atrue%2C%22Reports%22%3Atrue%2C%22Settings%22%3Atrue%2C%22OnlyNewUI%22%3Atrue%7D

phone String Optional. The phone number to be associated with the user account
note String Optional. A note to be associated with the user account
forcePasswordChange Boolean Optional. true | false
Indicates whether the user should be forced to change their 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 incldues the following:

  • lastName
  • phone
  • status
  • viewMessageOn
  • createBy
  • password
  • contactMethod
  • forcePasswordChange
  • lastLoginOn
  • id
  • viewPermission
  • username
  • email
  • smsemail
  • roles
  • priv
  • firstName
  • note
  • smsEmailFormat

 

Example

Request:
curl "https://apiAccount.logicmonitor.com/santaba/rpc/updateAccount?c=apiAccount&u=apiUser&p=example&id=19&username=API&password=apiPassword&roles=2,4&status=active&contactMethod=email&email=sarah.terry@logicmonitor.com&forcePasswordChange=false&viewPermission=%7B%22Dashboards%22%3Atrue%2C%22Hosts%22%3Atrue%2C%22Services%22%3Atrue%2C%22Alerts%22%3Atrue%2C%22Reports%22%3Atrue%2C%22Settings%22%3Atrue%7D" 
Response:
{
  "status": 200,
  "data": {
    "lastName": "",
    "phone": "",
    "status": "active",
    "viewMessageOn": "",
    "createBy": "LogicMonitor",
    "password": "********",
    "contactMethod": "email",
    "forcePasswordChange": 0,
    "lastLoginOn": "2015-11-19 11:09:00 PST",
    "id": 19,
    "viewPermission": {
      "Dashboards": true,
      "Services": true,
      "Reports": true,
      "Settings": true,
      "Hosts": true,
      "Alerts": true
    },
    "username": "API",
    "email": "sarah.terry@logicmonitor.com",
    "smsemail": "",
    "roles": [
      {
        "id": 2,
        "customHelpURL": "",
        "description": "Able to view everything. No ability to make changes",
        "name": "readonly",
        "customHelpLabel": "",
        "privileges": []
      },
      {
        "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": []
      }
    ],
    "priv": "readwrite",
    "firstName": "",
    "note": "",
    "smsEmailFormat": ""
  },
  "errmsg": "OK"
}