Save the page template draft
Saves the draft. Creates the page template on the first save (201). Saving does not change the live page; publish the draft for that. Fields you omit keep their current value.
The draft is validated: Liquid syntax, the required top-level {% store_buttons %} tag, the
allowed HTML and CSS, the page's Content Security Policy, and the size limits (body 65,536
bytes, CSS 32,768 bytes). Problems are returned with the field and line they are on.
Saving, publishing and previewing share a limit of 60 requests per minute per API key.
Requirements: a Pro plan, page templates enabled for the project, and an API key of a project
owner or manager with the page_templates.update scope.
Authorization<token>Format: Authorization: Token {api_key}
application/json- body
body?stringLiquid and HTML for the page body, at most 65,536 bytes (UTF-8, so fewer characters if you
use non-ASCII text). Must include {% store_buttons %} at the top level. Omit to keep the
current value; send an empty string to clear it. null is rejected.
css?stringPlain CSS for the page, at most 32,768 bytes. Omit to keep the current value; send an empty
string to clear it. null is rejected.
Draft saved
application/json- response
id?stringUUID of the page template
uuidbody?stringBody of the draft
css?stringCSS of the draft
unpublished_changes?booleanWhether the draft differs from the live version
live_version?|nullThe version links currently show, or null if nothing is published
created_at?stringdate-timeupdated_at?stringdate-timecurl -X PATCH 'https://dynalinks.app/api/v1/page_template' \ -H 'Content-Type: application/json' \ -d '{ "body": "<div class=\"page\">{{ link.title }}</div>\n{% store_buttons %}", "css": ".page { color: #111; }"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "body": "string", "css": "string", "unpublished_changes": true, "live_version": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "published_at": "2019-08-24T14:15:22Z", "live": true, "body": "string", "css": "string" }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}Get the page template GET
Returns the project's page template: the draft and the live version links currently show. **Requirements**: a Pro plan, page templates enabled for the project, and an API key of a project owner or manager with the `page_templates.show` scope.
Publish the page template draft POST
Publishes the draft as a new version. **This changes the page every link in the project shows.** Send `body` and/or `css` to save them first, as with `PATCH /page_template`. The last 20 versions are kept. Versions published through the API are recorded as published by the project owner. The request body is optional. When you send one, send `Content-Type: application/json`. Saving, publishing and previewing share a limit of 60 requests per minute per API key. **Requirements**: a Pro plan, page templates enabled for the project, and an API key of a project owner or manager with the `page_templates.publish` scope. API keys with no scopes have full access, so they can publish too. The `page_templates.publish` scope is enough to save a posted `body` or `css` here; `page_templates.update` is not needed.