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 account information, or a list of subaccounts with their name, status, and the current number of active checks.
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 }
Update account information
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" ] }
Create a new SubAccount. Note that id and customerid are not supported for POST calls on accounts. SubAccount IDs are assigned automatically.
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 a subaccount. You cannot delete your own account using this call.
Request example:
curl -X DELETE 'https://api.nodeping.com/api/1/accounts?customerid=201205102227VZ6XU'
Response example:
{"success":"Records queued for deletion."}
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.
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 }