Accounts
The accounts endpoint just consists of a single method that returns information about the account behind the specified API key.
Get accounts details
As shown in the example below, you should first start by creating an instance of UptimeRobotService
. You can do this from an API key, which you can find on the Uptime Robot settings page.
Next, you can just call the GetAccountDetails
method, and get information about the monitors of the account:
@using Skybrud.Social.UptimeRobot
@using Skybrud.Social.UptimeRobot.Models.Accounts
@using Skybrud.Social.UptimeRobot.Responses.Accounts
@inherits WebViewPage<UptimeRobotService>
@{
// Make the request to the API
UptimeRobotGetAccountDetailsResponse response = Model.Accounts.GetAccountDetails();
// Get the account details from the response body
UptimeRobotAccountDetails account = response.Body.Account;
}
<p>Email: @account.Email</p>
<p>Monitor limit: @account.MonitorLimit</p>
<p>Monitor interval: @account.MonitorInterval</p>
<p>Monitors currently up: @account.UpMonitors</p>
<p>Monitors currently down: @account.DownMonitors</p>
<p>Monitors currently paused: @account.PausedMonitors</p>