API-referentie
Gehoste templates
Herbruikbare inhoud opstellen, renderen, testen, versioneren, publiceren en verzenden.
Geen operaties gevonden voor dit filter.
GET
API-sleutel/templatesGehoste templates opvragen
Gehoste templates opvragen
curl https://sendhq.cc/api/v1/templates \
-X GET \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"data": [],
"count": 0
}POST
API-sleutel/templatesEen gehoste template aanmaken
Een gehoste template aanmaken
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-sleutel/templates/:idConcepten, releases en gebruik ophalen
Concepten, releases en gebruik ophalen
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-sleutel/templates/:id/draftEen templateconcept automatisch opslaan
Een templateconcept automatisch opslaan
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-sleutel/templates/:id/draftEen nieuw concept maken op basis van de gepubliceerde release
Een nieuw concept maken op basis van de gepubliceerde release
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-sleutel/templates/:id/renderDe exacte serveruitvoer renderen
De exacte serveruitvoer renderen
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-sleutel/templates/:id/testEen testsnapshot verzenden
Een testsnapshot verzenden
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-sleutel/templates/:id/publishEen onveranderlijke templaterelease publiceren
Een onveranderlijke templaterelease publiceren
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-sleutel/templates/:id/archiveEen template archiveren
Een template archiveren
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-sleutel/templates/:id/restoreEen gearchiveerde template herstellen
Een gearchiveerde template herstellen
curl https://sendhq.cc/api/v1/templates/id_value/restore \
-X POST \
-H "Authorization: Bearer $SENDHQ_API_KEY"{
"template": {
"id": "tmpl_…",
"lifecycle": "active"
}
}