Guides & Tutorials

List templates

GET /api/templates.php

This endpoint returns list of templates of an organization.

Request parameters

Parameter Value
limit Number of records to return per request.

Value is capped at 1000.

Default: 1000
page Page number.

Default: 0
sort_by Sort records by field.

Possible values: name, created_at, modified_at

Default: name
sort_order Sort direction.

Possible values: asc, desc

Default: asc

Response parameters

Response is a list of objects. Where each object contains:

Parameter Value
id Template ID.
type Template type.

Possible values: default and wysiwyg.

Former refers to drag-and-drop template, latter custom HTML template.
name Template name.
created_at Template creation datetime in RFC3339 format.
modified_at Template last modification datetime in RFC3339 format.
preview_url URL to template HTML preview.

Example

$ curl -X GET -u "${USERNAME}:${PASSWORD}" \
  "https://${SUBDOMAIN}.sendsmaily.net/api/templates.php"

(JavaScript/JSON)

[
  {
    "id": 2,
    "type": "wysiwyg",
    "name": "Christmas",
    "created_at": "2022-04-21T14:47:42+03:00",
    "modified_at": "2022-04-21T14:48:06+03:00",
    "preview_url": "https://${SUBDOMAIN}.sendsmaily.net/template/preview/id/2/"
  },
  {
    "id": 1,
    "type": "default",
    "name": "My First template",
    "created_at": "2022-03-16T07:04:43+02:00",
    "modified_at": "2022-04-05T11:01:18+03:00",
    "preview_url": "https://${SUBDOMAIN}.sendsmaily.net/template/preview/id/1/"
  }
]