Content

Read a content key

Reads one key as the draft sees it (a staged edit wins over the live version). By default the response is the stored body itself, with its stored Content-Type. format=json wraps the body with its hash and type, format=post parses a blog post, and selector returns only the matched elements' tag, attributes and text (a cheap read of a large page). If you send more than one of these, selector wins over format=json, which wins over format=post. published=1 reads the last published version and ignores the draft.

Every successful read carries an ETag (the quoted contentHash); send it as If-Match on a later write to catch a concurrent edit.

get/api/v1/sites/{slug}/content/{key}

Request

  • Base URL: https://api.dotsy.ai
  • URL: https://api.dotsy.ai/api/v1/sites/{slug}/content/{key}
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Path parameters

slugstring required
Example:acme-studio

Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.

keystring required

Percent-encode each segment; '/' may be sent raw or as %2F. Keys may contain '/'.

Query parameters

format'json' | 'post'

json: { key, contentType, contentHash, updatedAt, body }. post: the parsed blog post (meta, body, head).

selectorstring

A tag, class, id or attribute selector, for example h1.hero-title or nav a[href='/']. Returns the matched elements' tag, attributes and text instead of the body.

published'1'

1: the last published version, ignoring the draft. 404 no_published_version if it was never published.

Response

The body, or the JSON form you asked for. Without format or selector the body is returned as is, with its stored Content-Type.

OR
OR

Example response

{
  "key": "about.html",
  "contentType": "text/html; charset=utf-8",
  "contentHash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
}

Changes

No recorded changes to this operation across all 1 revision of this API.