The Dyspatch API is based on the REST paradigm, and features resource based URLs with standard HTTP response codes to indicate errors. We use standard HTTP authentication and request verbs, and all responses are JSON formatted. See our Implementation Guide for more details on how to implement Dyspatch.
Templates are the email templates found in your Dyspatch account. Only the published Template Draft is returned. A typical integration will start with using the Templates list endpoint to iterate through and sync Templates.
Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.
cursor | string A cursor value used to retrieve a specific page from a paginated result set. |
Accept required | string A version of the API that should be used for the request. For example, to use version "2019.03", set the value to "application/vnd.dyspatch.2019.03+json" |
{- "cursor": {
- "next": "string",
- "hasMore": true
}, - "data": [
- {
- "id": "tem_g3L7Cw6Hp5wU",
- "name": "string",
- "description": "string",
- "url": "/templates/tem_g3L7Cw6Hp5wUaf395LehwK",
- "localizations": [
- {
- "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
- "language": "en-US",
- "name": "English (US)",
- "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK"
}
], - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
]
}
Gets a template object with the matching ID. Templates without a published draft will result in an error.
templateId required | string A template ID |
targetLanguage required | string Enum: "html" "handlebars" "ampscript" "freemarker" "cheetah" "jinja" The type of templating language to compile as. Should only be used for visual templates. |
Accept required | string A version of the API that should be used for the request. For example, to use version "2019.03", set the value to "application/vnd.dyspatch.2019.03+json" |
{- "id": "tem_g3L7Cw6Hp5wU",
- "name": "string",
- "description": "string",
- "url": "/templates/tem_g3L7Cw6Hp5wUaf395LehwK",
- "compiled": {
- "sender": "Example <example@dyspatch.io>",
- "replyTo": "Example <example@dyspatch.io>",
- "subject": "PGh0bWw+PC9odG1sPgo=",
- "html": "PGh0bWw+PC9odG1sPgo=",
- "text": "PGh0bWw+PC9odG1sPgo="
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "localizations": [
- {
- "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
- "language": "en-US",
- "name": "English (US)",
- "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK"
}
]
}
Localization objects are the same as Template objects except they contain localized content. If your account is using localizations then use this instead of the compiled Template object.
Returns a specific localization object with a matching ID
localizationId required | string A localization ID |
targetLanguage required | string Enum: "html" "handlebars" "ampscript" "freemarker" "cheetah" "jinja" The type of templating language to compile as. Should only be used for visual templates. |
Accept required | string A version of the API that should be used for the request. For example, to use version "2019.03", set the value to "application/vnd.dyspatch.2019.03+json" |
{- "id": "loc_g3L7Cw6Hp5wUaf395LehwK",
- "language": "en-US",
- "url": "/localizations/loc_g3L7Cw6Hp5wUaf395LehwK",
- "template": "tem_g3L7Cw6Hp5wU",
- "compiled": {
- "sender": "Example <example@dyspatch.io>",
- "replyTo": "Example <example@dyspatch.io>",
- "subject": "PGh0bWw+PC9odG1sPgo=",
- "html": "PGh0bWw+PC9odG1sPgo=",
- "text": "PGh0bWw+PC9odG1sPgo="
}, - "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "name": "English (US)"
}