All URIs are relative to https://api.dyspatch.io
| Method | HTTP request | Description |
|---|---|---|
| get_template_by_id | GET /templates/{templateId} | Get Template by ID |
| get_templates | GET /templates | List Templates |
TemplateRead get_template_by_id(template_id, target_language, 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 .
# load the gem
require 'dyspatch_client'
# setup authorization
DyspatchClient.configure do |config|
# Configure API key authorization: Bearer
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = DyspatchClient::TemplatesApi.new
template_id = 'template_id_example' # String | A template ID
target_language = 'target_language_example' # String | The type of templating language to compile as. Should only be used for visual templates.
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\"
begin
#Get Template by ID
result = api_instance.get_template_by_id(template_id, target_language, accept)
p result
rescue DyspatchClient::ApiError => e
puts "Exception when calling TemplatesApi->get_template_by_id: #{e}"
end| Name | Type | Description | Notes |
|---|---|---|---|
| template_id | String | A template ID | |
| target_language | 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" |
- Content-Type: Not defined
- Accept: application/vnd.dyspatch.2020.11+json, /
TemplatesRead get_templates(accept, opts)
List Templates
Gets a list of Template Metadata objects for all templates. Up to 25 results returned before results are paginated.
# load the gem
require 'dyspatch_client'
# setup authorization
DyspatchClient.configure do |config|
# Configure API key authorization: Bearer
config.api_key['Authorization'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
#config.api_key_prefix['Authorization'] = 'Bearer'
end
api_instance = DyspatchClient::TemplatesApi.new
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\"
opts = {
cursor: 'cursor_example' # String | A cursor value used to retrieve a specific page from a paginated result set.
}
begin
#List Templates
result = api_instance.get_templates(accept, opts)
p result
rescue DyspatchClient::ApiError => e
puts "Exception when calling TemplatesApi->get_templates: #{e}"
end| 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] |
- Content-Type: Not defined
- Accept: application/vnd.dyspatch.2020.11+json, /