Eggplant Monitoring API Query Examples
To illustrate how the API might be used, here is a selection of examples showing sample goals, their query strings, and their responses. Variable elements of the query string are highlighted in red. You can copy the query string, amending these variable elements to match your own circumstances, and then run the query on your own account.
Page Monitor Status and Test Results
Test Filters
- Select the account ID
- Select page monitor
- Set StartDate to today
- Set StartTime to 00:00:00
- Set EndTime to Now using the pop-up time picker
Data Filters
Under Account > Pages > Page, select Url, Label, CurrentStatus, and ResultCode.
Under Account > Pages > Page > TestResults > TestResult, select LocalDateTime, Status, and ResultCode.
Query String (Generated by the Query Builder)
https://api.mon.eggplant.cloud/current/
abcdefghijklmnopqrstuvwxyz123456
/Return/[Account[Pages[Page[Url,Label,CurrentStatus,ResultCode,TestResults[TestResult[LocalDateTime,Status,ResultCode]]]]]]/AccountId/
MN1A8878
/Id/
MN1PG43413
/StartDate/
2014-05-25
/StartTime/00:00:00/EndTime/
11:49:33
/
Response in XML Format
<SiteConfidenceApi Version="current">
<Request Return="[Account[Pages[Page[Url,Label,CurrentStatus,ResultCode,TestResults[TestResult[LocalDateTime,Status,ResultCode]]]]]]" AccountId="MN1A8878" Id="MN1PG43413" StartDate="2014-05-25" StartTime="00:00:00" EndTime="11:49:33" />
<Response Status="Ok" Code="200" Message="Success.">
<Account>
<Pages>
<Page Url="http://www.bbc.co.uk/sport/0/football/" Label="BBC Football Home Page S1" CurrentStatus="OK" ResultCode="1">
<TestResults>
<TestResult LocalDateTime="2014-05-25 00:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 01:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 02:33:40" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 03:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 04:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 05:33:40" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 06:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 07:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 08:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 09:33:40" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 10:33:39" Status="OK" ResultCode="1"/>
<TestResult LocalDateTime="2014-05-25 11:33:39" Status="OK" ResultCode="1"/>
</TestResults>
</Page>
</Pages>
</Account>
</Response>
</SiteConfidenceApi>
The response shows that 12 tests have run so far today, and that all of those completed successfully without warnings (status OK, result code 1). Note that test results are displayed in chronological order, with the oldest results displayed first.
Average Speed of a User Journey
Test Filters
- Select account ID
- Select user journey (automatically selects all the steps in the user journey)
Data Filters
- Under Account > UserJourneys > UserJourney, select Label.
- Under Account > UserJourneys > UserJourney > TestingSummary > Last7Days, select AverageDownloadSpeed.
- Under Account > UserJourneys > UserJourney > Steps > Step, select Label.
- Under Account > UserJourneys > UserJourney > Steps > Step > TestingSummary > Last7Days, select AverageDownloadSpeed.
Query String (Generated by the Query Builder)
https://api.mon.eggplant.cloud/current/
abcdefghijklmnopqrstuvwxyz123456
/Return/[Account[UserJourneys[UserJourney[Label,TestingSummary[Last7Days[AverageDownloadSpeed]],Steps[Step[Label,TestingSummary[Last7Days[AverageDownloadSpeed]]]]]]]]/AccountId/
MN1A8878
/Id/
MN1UJ4065
,
MN1UJ4065S50760
,
MN1UJ4065S50761
,
MN1UJ4065S50762
,
MN1UJ4065S50763
,
MN1UJ4065S50764
,
MN1UJ4065S51246
,
MN1UJ4065S51824
/
Response in XML Format
<SiteConfidenceApi Version="current">
<Request Return="[Account[UserJourneys[UserJourney[Label,TestingSummary[Last7Days[AverageDownloadSpeed]],Steps[Step[Label,TestingSummary[Last7Days[AverageDownloadSpeed]]]]]]]]" AccountId="MN1A8878" Id="MN1UJ4065,MN1UJ4065S50760,MN1UJ4065S50761,MN1UJ4065S50762,MN1UJ4065S50763,MN1UJ4065S50764,MN1UJ4065S51246,MN1UJ4065S51824"/>
<Response Status="Ok" Code="200" Message="Success.">
<Account>
<UserJourneys>
<UserJourney Label="Test Journey">
<TestingSummary>
<Last7Days AverageDownloadSpeed="5.1024286"/>
</TestingSummary>
<Steps>
<Step Label="Step 1">
<TestingSummary>
<Last7Days AverageDownloadSpeed="2.8974286"/>
</TestingSummary>
</Step>
<Step Label="Step 2">
<TestingSummary>
<Last7Days AverageDownloadSpeed="0.7018571"/>
</TestingSummary>
</Step>
…
</Steps>
</UserJourney>
</UserJourneys>
</Account>
</Response>
</SiteConfidenceApi>
This response shows that the average download speed of the journey over the past seven days was 5.10 seconds and that the average download speed of the first two steps (others have been omitted for conciseness) is 2.89 seconds and 0.70 seconds, respectively.
Page Monitor Uptime for the Previous Calendar Month
Test Filters
- Select account ID
- Select page monitor
- Set StartDate to the first day of the previous calendar month
- Set StartTime to 00:00:00
- Set EndDate to the last day of the previous calendar month
- Set EndTime to 23:59:59
Data Filters
- Under Account > Pages > Page, select Url and Label.
- Under Account > Pages > Page > AvailabilitySummary > Availability, select Time.
- Under Account > Pages > Page > AvailabilitySummary > Availability > Uptime, select Percentage and Time.
- Under Account > Pages > Page > AvailabilitySummary > Availability > Warning, select Percentage and Time.
- Under Account > Pages > Page > AvailabilitySummary > Availability > Problem, select Percentage and Time.
- Under Account > Pages > Page > AvailabilitySummary > Availability > Down, select Percentage and Time.
Query String (Generated by the Query Builder)
https://api.mon.eggplant.cloud/current/
abcdefghijklmnopqrstuvwxyz123456
/Return/[Account[Pages[Page[Url,Label,AvailabilitySummary[Availability[Time,Uptime[Percentage,Time],Warning[Percentage,Time],Problem[Percentage,Time],Down[Percentage,Time]]]]]]]/AccountId/
MN1A8878
/Id/
MN1PG50365
/StartDate/
2014-04-01
/StartTime/00:00:00/EndDate/2014-04-30/EndTime/23:59:59/
Response in XML Format
<SiteConfidenceApi Version="current">
<Request Return="[Account[Pages[Page[Url,Label,AvailabilitySummary[Availability[Time,Uptime[Percentage,Time],Warning[Percentage,Time],Problem[Percentage,Time],Down[Percentage,Time]]]]]]]" AccountId="MN1A8878" Id="MN1PG50365" StartDate="2014-04-01" StartTime="00:00:00" EndDate="2014-04-30" EndTime="23:59:59"/>
<Response Status="Ok" Code="200" Message="Success.">
<Account>
<Pages>
<Page Url="http://www.o2.co.uk/login" Label="http://www.o2.co.uk/login">
<AvailabilitySummary>
<Availability Time="2592000">
<Uptime Percentage="99.106211419753" Time="2568833"/>
<Warning Percentage="0.13846450617284" Time="3589"/>
<Problem Percentage="0" Time="0"/>
<Down Percentage="0.75532407407407" Time="19578"/>
</Availability>
</AvailabilitySummary>
</Page>
</Pages>
</Account>
</Response>
</SiteConfidenceApi>
This response shows that during the previous calendar month, the uptime percentage for the monitor was 99.10%. This is the time that the monitor was up (2568833 seconds) expressed as a percentage of the total time period for the previous calendar month (2592000 seconds). Similarly, the monitor was in a confirmed Warning status for 0.14% of the month, a confirmed Problem status for 0% of the month and a confirmed Down status for 0.76% of the month.