OPWS Developers

템플릿 (Templates)

oe.templates.*는 방송 템플릿의 전체 CRUD를 제공합니다. 템플릿은 컨텐츠와 대상 그룹을 묶은 재사용 단위로, 예약 방송에 필수입니다.

oe.templates.create()

컨텐츠 handle과 그룹 handle이 필요합니다. 각각 contents.list()·groups.list()로 조회합니다.

ts
create(req: CreateTemplateInput): Promise<TemplateView>
ts
await oe.templates.create({
  name: "오전 안내 방송",
  contentHandle: "cnt_welcome",
  groupHandle: "grp_1f",
  languageOrder: "ko,en",   // 선택 — 언어 재생 순서
});
필드필수설명
name템플릿 이름
contentHandle방송에 사용할 컨텐츠 handle
groupHandle방송 대상 그룹 handle
languageOrder아니오언어 재생 순서(예 "ko,en")

oe.templates.list()

ts
list(): Promise<TemplateView[]>
ts
const templates = await oe.templates.list();
// TemplateView: handle · name · contentHandle · targetMode

oe.templates.get()

ts
get(handle: string): Promise<TemplateView>
ts
const template = await oe.templates.get("tpl_morning");

oe.templates.update()

이름과 언어 순서만 변경할 수 있습니다.

ts
update(handle: string, req: UpdateTemplateInput): Promise<TemplateView>
ts
await oe.templates.update("tpl_morning", {
  name: "오전 인사 방송",
  languageOrder: "ko",
});

oe.templates.delete()

ts
delete(handle: string): Promise<void>
ts
await oe.templates.delete("tpl_morning");

모든 templates 호출은 TEMPLATE MANAGE capability가 필요합니다.