View Heartbeat Statistics
This API endpoint retrieves heartbeat statistics for a specified resource over a specified time range. Query parameters such as interval, start_date, and end_date allow controlling the time range and granularity of the statistics.

Authorization: Bearer YOUR_TOKEN


Path Parameters
  • id string
    The unique ID of the resource for which heartbeat statistics are being retrieved. Example: '47f84f9f-a742-4ef9-be40-e7d7a6fa4039'
Query Parameters
  • interval (optional) string
    Defines the interval for retrieving statistics. This can be included based on your preference.
    Accepted values: 1h, 3h, 12h, 1d, 3d, 7d, 30d
  • start_date (optional) string
  • end_date (optional) string
JavaScript
Response codes
const axios = require('axios');

const url = "https://statistic-query.api.pinghome.io/v1/heartbeat/47f84f9f-a742-4ef9-be40-e7d7a6fa4039/statistic?interval=7d&start_date=2022-04-03T21:00:00Z&end_date=2022-04-03T22:04:00Z";

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).