Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.64 KB

templates.md

File metadata and controls

34 lines (28 loc) · 1.64 KB

Templates

This library provides easy access to the Templates Resource.

Note: All methods return promises and accept an optional last argument callback. Read about how we handle callbacks and promises.

Methods

  • list()
    List a summary of all templates.
  • get(id[, options])
    Get details about a specified template by its id
    • options.id - the id of the template you want to look up required
    • options.draft - specifies a draft or published template
  • create(template)
    Create a new template
  • update(id, template[, options])
    Update an existing template
    • id - the id of the template you want to update required
    • template - an object of template attributes required
    • options.update_published - If true, directly overwrite the existing published template. If false, create a new draft.
  • delete(id)
    Delete an existing template
    • id - the id of the template you want to delete required
  • preview(id[, options])
    Preview the most recent version of an existing template by id
    • id - the id of the template you want to look up required
    • options.substitution_data - Object of substitution data
    • options.draft - specifies a draft or published template

Examples

Visit our examples section to see all of our template resource examples.