API 레퍼런스
호스팅 템플릿
재사용 가능한 콘텐츠를 초안 작성, 렌더링, 테스트, 버전 관리, 게시, 발송합니다.
이 필터와 일치하는 작업이 없습니다.
GET
API 키/templates호스팅 템플릿 목록 조회
호스팅 템플릿 목록 조회
curl https://sendhq.cc/api/v1/templates \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}POST
API 키/templates호스팅 템플릿 생성
호스팅 템플릿 생성
curl https://sendhq.cc/api/v1/templates \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Account welcome","key":"account-welcome","starter":"welcome"}'{
"template": {
"id": "tmpl_…",
"key": "account-welcome"
}
}GET
API 키/templates/:id초안, 릴리스, 사용 현황 조회
초안, 릴리스, 사용 현황 조회
curl https://sendhq.cc/api/v1/templates/id_value \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…"
},
"versions": [],
"draft": null,
"activeVersion": null,
"usage": []
}PUT
API 키/templates/:id/draft템플릿 초안 자동 저장
템플릿 초안 자동 저장
curl https://sendhq.cc/api/v1/templates/id_value/draft \
-X PUT \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"revision":1,"name":"Account welcome","subjectTemplate":"Welcome, {{first_name}}","htmlTemplate":"<h1>Welcome, {{first_name}}</h1>","textTemplate":"Welcome, {{first_name}}","variables":[{"key":"first_name","type":"string","required":true}],"sampleData":{"first_name":"Asha"}}'{
"draft": {
"id": "tmplv_…",
"revision": 2
}
}POST
API 키/templates/:id/draft게시된 릴리스에서 새 초안 생성
게시된 릴리스에서 새 초안 생성
curl https://sendhq.cc/api/v1/templates/id_value/draft \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"draft": {
"id": "tmplv_…",
"revision": 1
}
}POST
API 키/templates/:id/render서버가 실제로 출력하는 결과 렌더링
서버가 실제로 출력하는 결과 렌더링
curl https://sendhq.cc/api/v1/templates/id_value/render \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"data":{"first_name":"Asha"}}'{
"subject": "Welcome, Asha",
"html": "<h1>Welcome, Asha</h1>",
"text": "Welcome, Asha",
"findings": []
}POST
API 키/templates/:id/test테스트 스냅샷 발송
테스트 스냅샷 발송
curl https://sendhq.cc/api/v1/templates/id_value/test \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{"to":["owner@example.com"],"from":"hello@example.com","data":{"first_name":"Asha"}}'{
"id": "em_…",
"isTest": true
}POST
API 키/templates/:id/publish변경 불가능한 템플릿 릴리스 게시
변경 불가능한 템플릿 릴리스 게시
curl https://sendhq.cc/api/v1/templates/id_value/publish \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"version": {
"id": "tmplv_…",
"state": "published"
}
}POST
API 키/templates/:id/archive템플릿 보관 처리
템플릿 보관 처리
curl https://sendhq.cc/api/v1/templates/id_value/archive \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…",
"lifecycle": "archived"
}
}POST
API 키/templates/:id/restore보관된 템플릿 복원
보관된 템플릿 복원
curl https://sendhq.cc/api/v1/templates/id_value/restore \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…",
"lifecycle": "active"
}
}