Incident Schedule Management
Incident schedule management focuses on organizing and managing on-call schedules for incident response teams. It retrieves schedules for specific customers, create new on-call schedules for teams, update existing schedules, and delete schedules as needed. This ensures that teams are effectively organized and available to respond to incidents, providing continuous coverage and support.
ENDPOINTS
Collapse all
  • On-call schedule management
    GET/customer/{id}/schedule
    POST/team/{id}/schedule
    PUT/team/{id}/schedule
    DELETE/team/{id}/schedule
Get Customer Schedule
This API endpoint retrieves the schedule data associated with a specific customer. The customer ID is provided as a path parameter.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will return the schedule data, including start and end dates, months, weeks, and days of the schedule.
  • If the request is unauthorized, the system will return an authentication error message.
Path Parameters
  • id string
    The unique ID of the customer whose schedule is being retrieved. Example: 'c03b02ec-244f-4d2c-8f68-3910071ed5c8'
JavaScript
Response codes
const axios = require('axios');

const url = "https://incident-query.api.pinghome.io/default/v1/customer/c03b02ec-244f-4d2c-8f68-3910071ed5c8/schedule";

axios.get(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  }
})
.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).
Create On-Call Schedule
This API endpoint creates a new on-call schedule for a team. The request body requires fields such as the team member ID, start and end dates, months of the year, weeks of the month, week days, and time range.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will create a new schedule and return a confirmation message.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Path Parameters
  • id string
    The unique ID of the team for which the schedule is being created. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • team_member_id string
    The unique ID of the team member assigned to the schedule.
  • start_date (advanced) string
  • end_date (advanced) string
  • months_of_year (advanced) array of positive integers
  • weeks_of_month (advanced) array of integers
  • week_days array of positive integers and zero
  • start_time string
  • end_time string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/default/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/schedule';
const data = {
  team_member_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
  start_date: "2024-01-01T00:00:00Z",
  end_date: "2024-01-31T23:59:59Z",
  months_of_year: [1],
  weeks_of_month: [1],
  week_days: [1],
  start_time: "00:00:00",
  end_time: "23:59:59"
};

axios.post(url, data, {
  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).
Update On-Call Schedule
This API endpoint updates an existing on-call schedule for a team. The request body requires fields such as the team member ID, start and end dates, and recurrence settings such as months of the year, weeks of the month, and days of the week.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will update the existing schedule and return a confirmation message.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Path Parameters
  • id string
    The unique ID of the team for which the schedule is being updated. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Request Body Parameters
  • team_member_id string
    The unique ID of the team member assigned to the schedule.
  • start_date (advanced) string
  • created_at string
  • end_date (advanced) string
  • months_of_year (advanced) array of positive integers
  • weeks_of_month (advanced) array of integers
  • week_days array of positive integers and zero
  • start_time string
  • end_time string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/default/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/schedule';
const data = {
  team_member_id: "445a5c1f-c0eb-403a-96d7-3976e5dc74ed",
  created_at: "2024-01-01T00:00:00Z",
  start_date: "2024-01-01T00:00:00Z",
  end_date: "2024-01-31T23:59:59Z",
  months_of_year: [1],
  weeks_of_month: [1],
  week_days: [1],
  start_time: "00:00:00",
  end_time: "23:59:59"
};

axios.put(url, data, {
  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).
Delete On-Call Schedule
This API endpoint deletes an existing on-call schedule for a team member. The request requires query parameters such as team_member_id and created_at to be provided for the schedule to be deleted.

Authorization: Bearer YOUR_TOKEN


Expected Behavior:


  • On success, the system will delete the specified on-call schedule and return a confirmation message.
  • If the request is invalid, the system will return an error message with details of the invalid fields.
Path Parameters
  • id string
    The unique ID of the team for which the schedule is being deleted. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
Query Parameters
  • team_member_id string
    The unique ID of the team member whose schedule is being deleted. Example: '445a5c1f-c0eb-403a-96d7-3976e5dc74ed'
  • created_at string
JavaScript
Response codes
const axios = require('axios');

const url = 'https://incident-cmd.api.pinghome.io/default/v1/team/445a5c1f-c0eb-403a-96d7-3976e5dc74ed/schedule';

axios.delete(url, {
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN'
  },
  params: {
    'team_member_id': '445a5c1f-c0eb-403a-96d7-3976e5dc74ed',
    'created_at': '2024-01-01T00:00:00Z'
  }
})
.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).