Latest Draft Beta

Get Latest Draft

Required scope: public-api:write public-api:drafts:read

Description

This endpoint returns the most recent draft version of a document.

The response is a JSON object with 5 possible top-level properties:

  • systemdata
  • metadata
  • content
  • references
  • renditions (deprecated)
Use Cases
Curl Example
ACCESS_TOKEN=ey1234
curl -k -X GET "https://server.livingdocs.io/api/beta/documents/:documentId/latestDraft" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

Endpoint

GET api/beta/documents/:documentId/latestDraft

Parameters

NameTypeRequiredNotes
:documentIdintegerx
?renditionsstringA comma-separated list of rendition handles. Example: ?renditions=web,json
?ignoreComponentConditionsbooleanProvides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks.
Added in: release-2024-03
Default: false
?componentConditionsstringJSON stringified object which contains the component conditions you would like to apply.
Added in: release-2024-03
Default: dateTime: new Date()
Example: ?componentConditions={"dateTime":"2024-02-14T17:25:10.391Z"}

Response

200
OK
{
  "systemdata": {
    "projectId": 1,
    "channelId": 1,
    "documentId": 603,
    "contentType": "regular",
    "documentType": "article",
    "firstPublicationDate": "2022-03-16T14:08:11:000Z",
    "significantPublicationDate": "2022-10-26T07:25:00.000Z",
    "visiblePublicationDate": "2022-10-27T06:00:00.000Z",
    "lastPublicationDate": "2023-02-22T16:33:42.836Z",
    "design": {
      "name": "living-times",
      "version": "1.0.4"
    }
  },
  "content": [
    {
      "id": "doc-1fsh4faeo0",
      "component": "article-container",
      "identifier": "living-times.article-container",
      "position": "fixed",
      "containers": {
        "main": [
          {
            "id": "doc-1fsh4faeo3",
            "component": "paragraph",
            "identifier": "living-times.paragraph",
            "content": {
              "text": "First paragraph published."
            }
          },
          {
            "id": "doc-1fsh4g83l0",
            "component": "paragraph",
            "identifier": "living-times.paragraph",
            "content": {
              "text": "Second paragraph unpublished."
            }
          }
        ]
      }
    }
  ],
  "references": [
    {
      "id": "KjqXSj2P1-L0",
      "type": "language-group",
      "location": "metadata",
      "propertyName": "language"
    }
  ],
  "metadata": {
    "language": {
      "label": "German",
      "locale": "de",
      "groupId": "KjqXSj2P1-L0"
    },
    "title": "Draft (Changed)"
  },
  "renditions": [
    {
      "handle": "web",
      // ...
    }
  ]
}