RPC API Developer's Guide

RPC API: Create a user

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

LogicMonitor's RPC API enables you to programmatically add users to your account with addAccount.

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

 

addAccount

URL:
https://accountName.logicmonitor.com/santaba/rpc/addAccount?c=accountName&u=Username&p=password&username=newAccount&password=newPassword&roles=4&status=active&contactMethod=email&email=test@logicmonitor.com&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 addAccount request:

Parameter

Type

Description

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

1: Administrator
2: Read Only
4: Acknowledge Only

status String Required. active | suspended
contactMethod String Required. email | smsemail
email String Required if contactMethod=email. The email address for the new user account.
smsemail String Required if contactMethod=smsemail. The smsemail address for the new user account.
smsEmailFormat String Required if contactMethod=smsemail. sms | fulltext
viewPermission String Required. The view permissions for the new user account. True/false permissions should be granted for Dashboards, Services, Reports, Settings, Hosts and Alerts. 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%22
Alerts%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 new user account
note String Optional. A note to be associated with the new user account
forcePasswordChange Boolean Optional. true | false
Indicates whether the new user should be forced to change their password when they fist log in

 

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/addAccount?c=apiAccount&u=apiUser&p=example&username=API&password=apiPassword&roles=1&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": "",
    "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": 1,
      "customHelpURL": "",
      "description": "Administrator can do everything",
      "name": "administrator",
      "customHelpLabel": "",
      "privileges": []
    }],
    "priv": "readwrite",
    "firstName": "",
    "note": "",
    "smsEmailFormat": ""
  },
  "errmsg": "OK"
}