View Uptime Monitor State Change History
This API allows you to monitor the state changes of your website or API in real-time. After adding a monitor, you can use this API to monitor state changes and view historical logs.

What is the API Used for?
This API provides you with historical state changes of the monitor and is useful in the following situations:
✅ Monitoring Downtime Events - See when the monitor goes down and when it recovers.
✅ Analyze Errors - Find out the cause of the problem, HTTP status code and other details.
✅ Perform a regional investigation - Determine in which region the error occurred.
✅ Confirm recovery - Verify that the monitor returns 200 OK responses after correcting the error.

How does it work?
1️. Create monitor - Add a monitor for your website or API via the Create Uptime Monitor API.
2️. Detect the problem - When a server error or connection problem occurs, the API logs an event.
3️. View event logs - Get the cause of the error, the time it occurred, and the status code.
4️. Resolve the issue - After restoring the service, confirm the new state and get a 200 OK response.

Authorization: Bearer YOUR_TOKEN

Path Parameters
  • id string
    The unique ID of the resource for which state change logs are being retrieved. Example: '6fb4e64f-ad18-46e3-920c-92639adb137c'
Query Parameters
  • start_date (optional) string
    Specifies the start date for retrieving state change logs if needed. Example: '2022-04-01T21:00:00Z'
  • end_date (optional) string
  • limit (optional) positive integer
JavaScript
Response codes
const axios = require('axios');

const url = "https://statistic-query.api.pinghome.io/v1/resource/6fb4e64f-ad18-46e3-920c-92639adb137c/state-changed-logs?start_date=2022-04-01T21:00:00Z&end_date=2022-04-07T22:04:00Z&limit=4";

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error);
});
ResponseThis section is used to view the possible HTTP response codes returned by the API. These codes indicate the status of a request, such as 201 (Created), 401 (Unauthorized), 409 (Conflict), or 422 (Unprocessable Entity).