Skip to content

Latest commit

 

History

History
118 lines (78 loc) · 4.09 KB

TemplatesApi.md

File metadata and controls

118 lines (78 loc) · 4.09 KB

DyspatchClient.TemplatesApi

All URIs are relative to https://api.dyspatch.io

Method HTTP request Description
getTemplateById GET /templates/{templateId} Get Template by ID
getTemplates GET /templates List Templates

getTemplateById

TemplateRead getTemplateById(templateId, targetLanguage, accept)

Get Template by ID

Gets a template object with the matching ID. If the template has published content the "compiled" field will contain the template .

Example

import DyspatchClient from 'dyspatch-client';
let defaultClient = DyspatchClient.ApiClient.instance;
// Configure API key authorization: Bearer
let Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

let apiInstance = new DyspatchClient.TemplatesApi();
let templateId = "templateId_example"; // String | A template ID
let targetLanguage = "targetLanguage_example"; // String | The type of templating language to compile as. Should only be used for visual templates.
let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
apiInstance.getTemplateById(templateId, targetLanguage, accept).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
templateId String A template ID
targetLanguage String The type of templating language to compile as. Should only be used for visual templates.
accept String A version of the API that should be used for the request. For example, to use version "2020.11", set the value to "application/vnd.dyspatch.2020.11+json"

Return type

TemplateRead

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.dyspatch.2020.11+json, /

getTemplates

TemplatesRead getTemplates(accept, opts)

List Templates

Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.

Example

import DyspatchClient from 'dyspatch-client';
let defaultClient = DyspatchClient.ApiClient.instance;
// Configure API key authorization: Bearer
let Bearer = defaultClient.authentications['Bearer'];
Bearer.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Bearer.apiKeyPrefix = 'Token';

let apiInstance = new DyspatchClient.TemplatesApi();
let accept = "accept_example"; // String | A version of the API that should be used for the request. For example, to use version \"2020.11\", set the value to \"application/vnd.dyspatch.2020.11+json\"
let opts = {
  'cursor': "cursor_example" // String | A cursor value used to retrieve a specific page from a paginated result set.
};
apiInstance.getTemplates(accept, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
accept String A version of the API that should be used for the request. For example, to use version "2020.11", set the value to "application/vnd.dyspatch.2020.11+json"
cursor String A cursor value used to retrieve a specific page from a paginated result set. [optional]

Return type

TemplatesRead

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/vnd.dyspatch.2020.11+json, /