Documentation

API Reference :: accounts

Account records hold information about the account or subaccount itself, including the account status, name, and so on. The API supports adding subaccounts to existing accounts, but it does not support signups to independent accounts (since you need an account token to access the API).

GET

Get account information, or a list of subaccounts with their name, status, and the current number of active checks.

  • customerid or id - optional - customerid of the subaccount you want to get. If absent, retrieves a list of accounts

Request example:

curl -X GET 'https://api.nodeping.com/api/1/accounts/201205102227VZ6XU'

Response example:

{
    "_id": "201205102227VZ6XU",
    "type": "customer",
    "customer_name": "My Company Name",
    "creation_date": 1336626000000,
    "status": "Active",
    "timezone": "-7.0",
    "nextBillingDate": "2012-05-15",
    "defaultlocations": [ "nam" ]
}

List request example:

curl -X GET 'https://api.nodeping.com/api/1/accounts'

Response example. The primary account includes an additional "parent" parameter that provides a count of SubAccounts (the example primary account shown below has five subaccounts, although not all are shown here).

{
    "201205050153W2Q4C": {
        "parent": 5,
        "name": "Peter Provider",
        "status": "Active",
        "count": 120
    },
    "201204251942S197J": {
        "name": "Courageous Charlie",
        "status": "Active",
        "count": 31
    }

PUT

Update account information

  • customerid or id - optional - customerid of the subaccount you want to change. If absent, your primary account will be updated
  • name - a name for the account, used primarily as a label in the accounts list.
  • timezone - optional - GMT offset for the account (example: '-7' is US Phoenix)
  • location - optional - The default region for checks for the account. This is a geographical region where our probe servers are located. Currently this can be set to 'nam' for North America, 'lam' for Latin America, 'eur' for Europe, 'eao' for East Asia/Oceania, or 'wlw' for worldwide.
  • autodiagnotifications - optional string - defaults to 'false'- set to 'true' to enable and 'false' to disable the account-wide configuration to send emails with the results of automated diagnostics to the email contact methods configured on the check to receive an immediate email.
  • emailme - optional - set to 'yes' to opt-in the subaccount for NodePing service and features email notifications. Defaults to 'no' if absent.
  • status - optional - subaccount status, set to "Active" or "Suspend". This parameter is not supported on parent accounts.

Request example:

curl -X PUT 'https://api.nodeping.com/api/1/accounts?customerid=201205102227VZ6XU&timezone=-5&status=Suspend

Response example:

{
    "_id": "201205102227VZ6XU",
    "type": "customer",
    "customer_name": "My Company Name",
    "creation_date": 1336626000000,
    "status": "Suspend",
    "timezone": "-5.0",
    "defaultlocations": [ "nam" ]
}

POST

Create a new SubAccount. Note that id and customerid are not supported for POST calls on accounts. SubAccount IDs are assigned automatically.

  • name - required - a name for the subaccount, used primarily as a label for the accounts list.
  • contactname - required - name of the primary contact for the subaccount
  • email - required - email of the primary contact for the subaccount
  • timezone - required - GMT offset for the account (example: '-7' is US Phoenix)
  • location - required - The default region for checks for the account. This is a geographical region where our probe servers are located. Currently this can be set to 'nam' for North America, 'eur' for Europe, 'eao' for East Asia/Oceania, or 'wlw' for worldwide.
  • emailme - optional - set to 'yes' to opt-in the subaccount for NodePing service and features email notifications. Defaults to 'no' if absent.

Request example:

curl -X POST 'https://api.nodeping.com/api/1/accounts?timezone=3&name=My+Company+Name&contactname=Joe+Smith&email=joe@example.com&timezone=3&location=eur&emailme=yes'

Response example:

{
    "_id": "201205102227VZ6XU",
    "type": "customer",
    "parent": "20120425194336LEV",
    "customer_name": "My Company Name",
    "creation_date": 1336626000000,
    "status": "Active",
    "emailme":true,
    "timezone": "3.0",
    "defaultlocations": [ "eur" ]
}

DELETE

Delete a subaccount. You cannot delete your own account using this call.

  • customerid or id - required - customerid of the subaccount you want to delete.

Request example:

curl -X DELETE 'https://api.nodeping.com/api/1/accounts?customerid=201205102227VZ6XU'

Response example:

{"success":"Records queued for deletion."}

Disable Notifications

Disable or re-enable all notifications for an account. This call returns an account object. When called on a parent account, this call does not suppress notifications in subaccounts. You have to make a separate call with the subaccount customerid in order to suppress notifications within subaccounts. Notifications suppressed with this call can also be re-enabled in the NodePing web UI under the 'Contacts' tab.

  • customerid - required string when disabling notifications on a subaccount - id of the subaccount.
  • accountsuppressall - required - PUT method only, 'true' or 'false'. Set to 'true' to disable all notifications on an account (does not effect subaccounts). Set to 'false' to re-enable notifications that had been disabled via this method. This will not re-enable contacts that were previously suppressed using the various suppression elements listed above.

Request example:

curl -X PUT 'https://api.nodeping.com/api/1/accounts?accountsuppressall=true'

Response example:

{
    "_id": "201205102227VZ6XU",
    "type": "customer",
    "customer_name": "My Company Name",
    "creation_date": 1336626000000,
    "status": "Active",
    "emailme":true,
    "timezone": "3.0",
    "defaultlocations": [ "eur" ],
    "accountsuppressall": true
}

If you have any questions, get in touch at support@nodeping.com, or use our Contact form.