템플릿 API 레퍼런스

페이지의 모든 템플릿 가져오기

엔드포인트:

GET /v1/:page_id/templates?page=:page&per_page=:per_page
  • 기본 page 번호는 1입니다.
  • 기본 per_page 값은 50이며 페이지당 최대 100개입니다.

응답 예시:

[
{
"id": "cl9mq0ah50646mpvlmbrvf979",
"type": "MAINTENANCE",
"name": "Some Template",
"nameTranslationId": null,
"message": "",
"messageTranslationId": null,
"messageHtml": "",
"messageHtmlTranslationId": null,
"status": "NOTSTARTEDYET",
"notify": true,
"createdAt": "2022-10-24T11:53:46.505Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFrom": null,
"deletedAt": null,
"components": [],
"translations": {
"name": null,
"message": null
}
},
{
"id": "cl9ranzrn0040xovluqicus6h",
"type": "INCIDENT",
"name": "Some Template 2",
"nameTranslationId": null,
"message": "We're currently investigating an issue with the Website",
"messageTranslationId": null,
"messageHtml": "<p>We&#39;re currently investigating an issue with the Website</p>",
"messageHtmlTranslationId": null,
"status": "INVESTIGATING",
"notify": true,
"createdAt": "2022-10-27T16:43:09.394Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFrom": null,
"deletedAt": null,
"components": [
{
"id": "cl9rbadkx0024lhvlicjbe304",
"status": "MAJOROUTAGE",
"isCustomPercentage": true,
"componentId": "cl9fzgipf14075qjvljphlnwkk",
"templateId": "cl9ranzrn0040xovluqicus6h",
"importedFrom": null
}
],
"translations": {
"name": null,
"message": null
}
}
]

템플릿 가져오기

엔드포인트:

GET /v1/:page_id/templates/:template_id

응답 예시:

{
"id": "cl9mq0ah50646mpvlmbrvf979",
"type": "MAINTENANCE",
"name": "Some Template",
"nameTranslationId": null,
"message": "",
"messageTranslationId": null,
"messageHtml": "",
"messageHtmlTranslationId": null,
"status": "NOTSTARTEDYET",
"notify": true,
"createdAt": "2022-10-24T11:53:46.505Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFrom": null,
"deletedAt": null,
"components": [],
"translations": {
"name": null,
"message": null
}
}

템플릿 추가하기

엔드포인트:

POST /v1/:page_id/templates

요청 예시:

{
"subdomain": "some-subdomain",
"type": "INCIDENT",
"name": "Test template",
"message": "We're currently investigating an issue with the Website",
"status": "INVESTIGATING",
"notify": true,
"components": [
{
"id": "cl9fzgipf14075qjvljphlnwkk",
"status": "PARTIALOUTAGE",
"customImpactPercentage": 40
}
],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

응답 예시:

{
"id": "cl9xobpoe00614tvldhh90t0w",
"type": "INCIDENT",
"name": "Test template",
"nameTranslationId": null,
"message": "We're currently investigating an issue with the Website",
"messageTranslationId": null,
"messageHtml": "<p>We&#39;re currently investigating an issue with the Website</p>",
"messageHtmlTranslationId": null,
"status": "INVESTIGATING",
"notify": true,
"createdAt": "2022-11-01T03:52:08.126Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFrom": null,
"deletedAt": null,
"components": [],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

템플릿 업데이트하기

엔드포인트:

PUT /v1/:page_id/templates/:template_id

요청 예시:

{
"type": "INCIDENT",
"name": "Test template 2",
"message": "We're currently investigating an issue with the Website",
"status": "INVESTIGATING",
"notify": true,
"components": [
{
"id": "cl9fzgipf14075qjvljphlnwkk",
"status": "MAJOROUTAGE"
}
],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

응답 예시:

{
"id": "cl9ranzrn0040xovluqicus6h",
"type": "INCIDENT",
"name": "Test template 2",
"nameTranslationId": null,
"message": "We're currently investigating an issue with the Website",
"messageTranslationId": null,
"messageHtml": "<p>We&#39;re currently investigating an issue with the Website</p>",
"messageHtmlTranslationId": null,
"status": "INVESTIGATING",
"notify": true,
"createdAt": "2022-10-27T16:43:09.394Z",
"siteId": "cl9fzgilx14063qjvl5oqdtxtg",
"importedFrom": null,
"deletedAt": null,
"components": [
{
"id": "cl9xockck01654tvlwfn7vbaz",
"status": "OPERATIONAL",
"componentId": "cl9fzgipf14075qjvljphlnwkk",
"templateId": "cl9ranzrn0040xovluqicus6h",
"importedFrom": null
}
],
"translations": {
"name": {
"fr": "Modèle de test"
},
"message": {
"fr": "Nous enquêtons actuellement sur un problème avec le site Web"
}
}
}

템플릿 삭제하기

엔드포인트:

DELETE /v1/:page_id/templates/:template_id

응답 예시:

{
"id": "cl9ra5iu20023bxvlu1x8bqj6",
"name": "Test template",
"message": "We're currently investigating an issue with the Website",
"createdAt": "2022-10-27T16:28:47.642Z",
"site": {
"id": "cl9fzgilx14063qjvl5oqdtxtg"
}
}