\n Paragraph\n
" - } - ], - "categories": [ - { - "id": "123abc", - "label": "Home", - "path": "/", - "metadata": { - "adId": "foo" - } - } - ], - "deliveries": [ - { - "handle": "web", - "label": "Website", - "isPrimary": true, - "icon": "book-open", - "url": { - "origin": "https://livingdocs.io", - "pathPattern": "/doc/:id" - } - } - ], - "notifications": { - "actionGroups": [ - { - "handle": "all", - "label": "All Events", - "description": "Comments, Tasks, Publish and delete", - "actions": [ - "task.change", - "document.publish", - "document.unpublish", - "document.copy", - "document.delete", - "document.transform", - "comment.add", - "comment.resolve" - ] - } - ], - "notifyTaskRequester": true, - "autoSubscribeOwner": { - "enabled": true, - "actionGroup": "all" - } - }, - "import": { - "allowedProjects": [ - { - "handle": "service-clone" - } - ] - }, - "export": { - "allowedProjects": [ - { - "handle": "service-clone" - } - ] - }, - "externalSystems": [ - { - "handle": "myExternalSystem", - "label": "My System", - "url": { - "origin": "https://example.com", - "pathPattern": "/{{metadata.myExternalSystemId}}" - }, - "icon": "track-light", - "isPrimary": false - } - ] -} -``` - -{{< /api-example >}} - - -{{< api-example - title="Get Project Configuration ({{< deprecated-in \"release-2023-03\" >}})" - scopes="public-api:read" ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/project" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/project -``` - ---parameters-- - ---description-- - -Deprecated: Use `GET api/v1/projectConfig` instead. - ---response-- -200 ---- ---- -```js -{ - "projectId": 1, - "name": "b5c5f804-7927-44e2-a3fd-f97bc6784dab", - "label": "Daily Planet", - "defaultChannelId": 1, - "channels": [ - { - "channelId": 1, - "channelHandle": "web", - "label": "Web", - "designName": "timeline", - "designVersion": "1.1.0", - "editMode": "default", - "contentTypeHandles": [ - "regular", - "page" - ], - "contentTypes": [ - { - "contentTypeHandle": "regular", - "documentType": "article", - "metadata": [ - { - "name": "title", - "plugin": "li-text" - }, - { - "name": "author", - "plugin": "li-text" - }, - { - "name": "teaserImage", - "plugin": "li-image" - }, - { - "name": "dependencies", - "plugin": "li-dependencies" - }, - { - "name": "tasks", - "plugin": "li-tasks" - } - ], - "renditionHandles": [ - "web", - "mobile" - ] - }, - { - "contentTypeHandle": "page", - "documentType": "page", - "metadata": [ - { - "name": "title", - "plugin": "li-text" - }, - { - "name": "dependencies", - "plugin": "li-dependencies" - }, - { - "name": "routing", - "plugin": "li-default-routing" - } - ], - "renditionHandles": [ - "web" - ] - } - ] - } - ] -} -``` - -{{< /api-example >}} - -{{< api-example - title="Get Channel Configuration ({{< deprecated-in \"release-2023-03\" >}})" - scopes="public-api:read" ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/channels/:channelHandle" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/channels/:channelHandle -``` - ---parameters-- -|Name|Type|Notes| -|-|-|-| -|:channelHandle|string|Optional channelHandle. Will return first channel of a project if none is passed.| - ---description-- - -Deprecated: Use `GET api/v1/projectConfig` instead. - ---response-- -200 ---- ---- -```js -{ - "channelId": 1, - "channelHandle": "web", - "label": "Web", - "designName": "timeline", - "designVersion": "1.1.0", - "editMode": "default", - "contentTypeHandles": [ - "regular", - "page" - ], - "contentTypes": [ - { - "contentTypeHandle": "regular", - "documentType": "article", - "metadata": [ - { - "name": "title", - "plugin": "li-text" - }, - { - "name": "author", - "plugin": "li-text" - }, - { - "name": "teaserImage", - "plugin": "li-image" - }, - { - "name": "dependencies", - "plugin": "li-dependencies" - }, - { - "name": "tasks", - "plugin": "li-tasks" - } - ], - "renditionHandles": [ - "web", - "mobile" - ] - }, - { - "contentTypeHandle": "page", - "documentType": "page", - "metadata": [ - { - "name": "title", - "plugin": "li-text" - }, - { - "name": "dependencies", - "plugin": "li-dependencies" - }, - { - "name": "routing", - "plugin": "li-default-routing" - } - ], - "renditionHandles": [ - "web" - ] - } - ] -} -``` - -{{< /api-example >}} - -{{< api-example - title="Get Design Configuration" - scopes="public-api:read" ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/design/:designVersion" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/design/:designVersion -``` - ---parameters-- -|Name|Type|Notes| -|-|-|-| -|:designVersion|string|Optional design version. Will take the current design version of a channel if none is passed.| - ---description-- - -##### Use Cases - -- Load the appropriate Design Version for a document - ---response-- -200 ---- ---- -```js -{ - "name": "p:1:1", - "version": "1.0.0", - "assets": { - "css": [ - "https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css" - ] - }, - "defaultComponents": { - "paragraph": "p", - "image": "image" - }, - "groups": [ - { - "name": "content", - "label": "Components", - "components": [ - "title", - "p", - "image", - "insta" - ] - } - ], - "componentProperties": {}, - "metadata": [ - { - "identifier": "title", - "type": "text", - "matches": [ - "title.title" - ] - } - ], - "components": [ - { - "name": "title", - "label": "Title", - "iconUrl": "https://livingdocs-assets.s3.amazonaws.com/magazine-design/assets/images/icons-components/icon_header_simple.svg", - "html": "\n Paragraph\n
", - "directives": {} - }, - { - "name": "image", - "label": "Image", - "iconUrl": "https://livingdocs-assets.s3.amazonaws.com/magazine-design/assets/images/icons-components/icon_image.svg", - "directives": { - "img": { - "name": "img", - "type": "image", - "imageRatios": [ - "16:9", - "1:1", - "4:3", - "3:4" - ] - } - }, - "html": "" - }, - { - "name": "insta", - "label": "Instagram", - "iconUrl": "https://livingdocs-assets.s3.amazonaws.com/magazine-design/assets/images/icons-components/icon_image.svg", - "directives": { - "insta": { - "name": "insta", - "type": "include", - "service": "instagram" - } - }, - "html": "\n Paragraph\n
", + "directives": {} + }, + { + "name": "image", + "label": "Image", + "iconUrl": "https://livingdocs-assets.s3.amazonaws.com/magazine-design/assets/images/icons-components/icon_image.svg", + "directives": { + "img": { + "name": "img", + "type": "image", + "imageRatios": [ + "16:9", + "1:1", + "4:3", + "3:4" + ] + } + }, + "html": "" + }, + { + "name": "insta", + "label": "Instagram", + "iconUrl": "https://livingdocs-assets.s3.amazonaws.com/magazine-design/assets/images/icons-components/icon_image.svg", + "directives": { + "insta": { + "name": "insta", + "type": "include", + "service": "instagram" + } + }, + "html": "\n Paragraph\n
" + } + ], + "categories": [ + { + "id": "123abc", + "label": "Home", + "path": "/", + "metadata": { + "adId": "foo" + } + } + ], + "deliveries": [ + { + "handle": "web", + "label": "Website", + "isPrimary": true, + "icon": "book-open", + "url": { + "origin": "https://livingdocs.io", + "pathPattern": "/doc/:id" + } + } + ], + "notifications": { + "actionGroups": [ + { + "handle": "all", + "label": "All Events", + "description": "Comments, Tasks, Publish and delete", + "actions": [ + "task.change", + "document.publish", + "document.unpublish", + "document.copy", + "document.delete", + "document.transform", + "comment.add", + "comment.resolve" + ] + } + ], + "notifyTaskRequester": true, + "autoSubscribeOwner": { + "enabled": true, + "actionGroup": "all" + } + }, + "import": { + "allowedProjects": [ + { + "handle": "service-clone" + } + ] + }, + "export": { + "allowedProjects": [ + { + "handle": "service-clone" + } + ] + }, + "externalSystems": [ + { + "handle": "myExternalSystem", + "label": "My System", + "url": { + "origin": "https://example.com", + "pathPattern": "/{{metadata.myExternalSystemId}}" + }, + "icon": "track-light", + "isPrimary": false + } + ] + } diff --git a/content/reference/public-api/project/get_project_configuration.yaml b/content/reference/public-api/project/get_project_configuration.yaml new file mode 100644 index 000000000..d9da2f8c4 --- /dev/null +++ b/content/reference/public-api/project/get_project_configuration.yaml @@ -0,0 +1,91 @@ +title: Get Project Configuration ({{< deprecated-in "release-2023-03" >}}) + +deprecation: + since: release-2023-03 + note: Use `GET api/v1/projectConfig` instead. + +scopes: public-api:read +query: | + ACCESS_TOKEN=ey1234 + curl -k -X GET "https://server.livingdocs.io/api/v1/project" \ + -H "Authorization: Bearer $ACCESS_TOKEN" +endpoint: + method: GET + path: /api/v1/project +deprecated: release-2023-03 +responses: + - code: "200" + body: | + { + "projectId": 1, + "name": "b5c5f804-7927-44e2-a3fd-f97bc6784dab", + "label": "Daily Planet", + "defaultChannelId": 1, + "channels": [ + { + "channelId": 1, + "channelHandle": "web", + "label": "Web", + "designName": "timeline", + "designVersion": "1.1.0", + "editMode": "default", + "contentTypeHandles": [ + "regular", + "page" + ], + "contentTypes": [ + { + "contentTypeHandle": "regular", + "documentType": "article", + "metadata": [ + { + "name": "title", + "plugin": "li-text" + }, + { + "name": "author", + "plugin": "li-text" + }, + { + "name": "teaserImage", + "plugin": "li-image" + }, + { + "name": "dependencies", + "plugin": "li-dependencies" + }, + { + "name": "tasks", + "plugin": "li-tasks" + } + ], + "renditionHandles": [ + "web", + "mobile" + ] + }, + { + "contentTypeHandle": "page", + "documentType": "page", + "metadata": [ + { + "name": "title", + "plugin": "li-text" + }, + { + "name": "dependencies", + "plugin": "li-dependencies" + }, + { + "name": "routing", + "plugin": "li-default-routing" + } + ], + "renditionHandles": [ + "web" + ] + } + ] + } + ] + } diff --git a/content/reference/public-api/publications/get_latest_publication.yaml b/content/reference/public-api/publications/get_latest_publication.yaml new file mode 100644 index 000000000..a8ff5120f --- /dev/null +++ b/content/reference/public-api/publications/get_latest_publication.yaml @@ -0,0 +1,192 @@ +title: Get Latest Publication +description: | + The endpoint provides an unresolved Publication with 4 possible top-level properties: + - systemdata + - metadata + - content + - renditions + + ##### Advantages + + - Be able to cache the response, because it only changes on a republish (does not contain resolved refs) + - Useful for a pull architecture + - (deprecated) Supports the Render Pipeline with it's Renditions + + ##### Related + + - [Latest Publication API Beta]({{< ref "/reference/public-api/publications/latest-publication-beta" >}}) + - [Composition API]({{< ref "/reference/public-api/composition-api" >}}) + +useCases: + - Load an unresolved Publication with the required information to render a document/page. + - Export the unresolved Publication to another system and get changes via [Publication Events]({{< ref "/reference/public-api/publications/publication-events" >}}) or [Webhooks]({{< ref "/reference/webhooks" >}}) + - (deprecated) Provides a Publication via a [Rendition]({{< ref "/reference/project-config/content-types#renditions" >}}) for a delivery in another format like `RSS`, `XML` + +scopes: public-api:read +query: | + ACCESS_TOKEN=ey1234 + curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/latestPublication" \ + -H "Authorization: Bearer $ACCESS_TOKEN" +endpoint: + method: GET + path: /api/v1/documents/:documentId/latestPublication +parameters: + - name: :documentId + type: integer + required: true + notes: "" + - name: ?fields + type: string + required: false + notes: "Filters which (comma separated) properties are included in the response. Defaults to `systemdata,metadata,content` (no renditions)." + - name: ?renditions + type: string + required: false + notes: | + A comma-separated list of rendition handles. + + Example: `?renditions=web,json` + + - name: ?ignoreComponentConditions + type: boolean + required: false + notes: | + {{< added-in \"release-2024-03\" >}} + + Provides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks. + + Default: `false` + + - name: ?componentConditions + type: string + required: false + notes: | + {{< added-in \"release-2024-03\" >}} + + JSON stringified object which contains the component conditions you would like to apply. + + Default: `{"dateTime": new Date()}` + Example: `?componentConditions={"dateTime":"2024-02-14T17:25:10.391Z"}` +responses: + - code: "200" + body: | + { + "systemdata": { + "projectId": 1, + "channelId": 1, + "documentId": 1, + "contentType": "regular", + "documentType": "article", + "publicationId": 1, + "firstPublicationDate": "2022-03-16T14:08:11:000Z", + "significantPublicationDate": "2022-10-26T07:25:00.000Z", + "visiblePublicationDate": "2022-10-27T06:00:00.000Z", + "lastPublicationDate": "2023-03-18T16:32:04.170Z", + "design": { + "name": "timeline", + "version": "1.1.0" + } + }, + "metadata": { + "title": "a title", + "description": "some lead", + "dependencies": {} + }, + "content": [ + { + "id": "doc-1b8i1ksh10", + "component": "head", + "identifier": "timeline.head", + "content": { + "title": "a title", + "text": "some lead" + } + }, + { + "id": "doc-1b8i1ksh20", + "component": "normal", + "identifier": "timeline.normal", + "content": { + "caption": "my caption" + }, + "styles": { + "position": "left" + } + }, + { + "id": "doc-1b8i1ksh30", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "first paragraph" + } + }, + { + "id": "doc-1b8i1me1d0", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "second paragraph" + } + } + ], + "renditions": [ + { + "handle": "web", + "content": "some lead
\nfirst paragraph
\nsecond
\nand third one. :)
" + }, + { + "handle": "mobile", + "content": { + "content": [ + { + "id": "doc-1b8i1ksh10", + "component": "head", + "identifier": "timeline.head", + "content": { + "title": "a title", + "text": "some lead" + } + }, + { + "id": "doc-1b8i1ksh20", + "component": "normal", + "identifier": "timeline.normal", + "content": { + "caption": "my caption" + }, + "styles": { + "position": "left" + } + }, + { + "id": "doc-1b8i1ksh30", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "first paragraph" + } + }, + { + "id": "doc-1b8i1me1d0", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "second paragraph" + } + } + ], + "design": { + "name": "timeline", + "version": "1.1.0" + } + } + }, + { + "handle": "app", + "error": { + "message": "Processing of Channel 'app' for document '1' failed. Detailed error message…" + } + } + ] + } diff --git a/content/reference/public-api/publications/get_latest_publication_beta.yaml b/content/reference/public-api/publications/get_latest_publication_beta.yaml new file mode 100644 index 000000000..31bb95ccb --- /dev/null +++ b/content/reference/public-api/publications/get_latest_publication_beta.yaml @@ -0,0 +1,198 @@ +title: Get Latest Publication +description: | + The endpoint provides an unresolved Publication with 5 possible top-level properties: + - systemdata + - metadata + - content + - renditions + - references + + Advantages: + - Be able to cache the response, because it only changes on a republish (does not contain resolved refs) + - Useful for a pull architecture + - (deprecated) Supports the Render Pipeline with it's Renditions + +useCases: | + - Load an unresolved Publication with the required information to render a document/page. + - Export the unresolved Publication to another system and get changes via [Publication Events]({{< ref "/reference/public-api/publications/publication-events" >}}) or [Webhooks]({{< ref "/reference/webhooks" >}}) + - (deprecated) Provides a Publication via a [Rendition]({{< ref "/reference/project-config/content-types#renditions" >}}) for a delivery in another format like `RSS`, `XML` + +scopes: public-api:read +beta: true +query: | + ACCESS_TOKEN=ey1234 + curl -k -X GET "https://server.livingdocs.io/api/beta/documents/:documentId/latestPublication" \ + -H "Authorization: Bearer $ACCESS_TOKEN" +endpoint: + method: GET + path: /api/beta/documents/:documentId/latestPublication +parameters: + - name: :documentId + type: integer + required: true + notes: "" + - name: ?fields + type: string + required: false + notes: "Filters which (comma separated) properties are included in the response. Defaults to `systemdata,metadata,content` (no renditions)." + - name: ?renditions + type: string + required: false + notes: | + A comma-separated list of rendition handles. + + Example: `?renditions=web,json` + + - name: ?ignoreComponentConditions + type: boolean + required: false + notes: | + {{< added-in \"release-2024-03\" >}} + + Provides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks. + + Default: `false` + + - name: ?componentConditions + type: string + required: false + notes: | + {{< added-in \"release-2024-03\" >}} + + JSON stringified object which contains the component conditions you would like to apply. + + Default: `{"dateTime": new Date()}` + Example: `?componentConditions={"dateTime":"2024-02-14T17:25:10.391Z"}` +responses: + - code: "200" + name: OK + endpoint: /api/beta/documents/:documentId/latestPublication + body: | + { + "systemdata": { + "projectId": 1, + "channelId": 1, + "documentId": 1, + "contentType": "article", + "documentType": "article", + "publicationId": 1, + "firstPublicationDate": "2022-03-16T14:08:11:000Z", + "significantPublicationDate": "2022-10-26T07:25:00.000Z", + "visiblePublicationDate": "2022-10-27T06:00:00.000Z", + "lastPublicationDate": "2023-03-18T16:32:04.170Z", + "design": { + "name": "timeline", + "version": "1.1.0" + } + }, + "metadata": { + "title": "a title", + "description": "some lead", + "dependencies": {} + }, + "content": [ + { + "id": "doc-1b8i1ksh10", + "component": "head", + "identifier": "timeline.head", + "content": { + "title": "a title", + "text": "some lead" + } + }, + { + "id": "doc-1b8i1ksh20", + "component": "normal", + "identifier": "timeline.normal", + "content": { + "caption": "my caption" + }, + "styles": { + "position": "left" + } + }, + { + "id": "doc-1b8i1ksh30", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "first paragraph" + } + }, + { + "id": "doc-1b8i1me1d0", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "second paragraph" + } + } + ], + "renditions": [ + { + "handle": "web", + "content": "some lead
\nfirst paragraph
\nsecond
\nand third one. :)
" + }, + { + "handle": "mobile", + "content": { + "content": [ + { + "id": "doc-1b8i1ksh10", + "component": "head", + "identifier": "timeline.head", + "content": { + "title": "a title", + "text": "some lead" + } + }, + { + "id": "doc-1b8i1ksh20", + "component": "normal", + "identifier": "timeline.normal", + "content": { + "caption": "my caption" + }, + "styles": { + "position": "left" + } + }, + { + "id": "doc-1b8i1ksh30", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "first paragraph" + } + }, + { + "id": "doc-1b8i1me1d0", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "second paragraph" + } + } + ], + "design": { + "name": "timeline", + "version": "1.1.0" + } + } + }, + { + "handle": "app", + "error": { + "message": "Processing of Channel 'app' for document '1' failed. Detailed error message…" + } + } + ], + "references": [ + { + "id": "YbzTpusGyJtF", + "type": "language-group", + "location": "metadata", + "propertyName": "language" + } + ] + } diff --git a/content/reference/public-api/publications/incoming_document_references.yaml b/content/reference/public-api/publications/incoming_document_references.yaml new file mode 100644 index 000000000..c18b5c91c --- /dev/null +++ b/content/reference/public-api/publications/incoming_document_references.yaml @@ -0,0 +1,74 @@ +title: Get Incoming Publication References for a Document +description: | + This endpoint returns all publications which link to this document (via content or metadata) + + The example below finds a reference to ID 1 when requesting for incomingDocumentReference with ID 2. + + {{< img src="./references.png" alt="Component Property" >}} + +useCases: | + - Find publications that link to this document for cache invalidation + + + >[!WARNING] + >- Eventual Consistency of Reference because of the usage of Elasticsearch + >- It is not supported to find publications in a [Document List]({{< ref "/reference/public-api/document-lists" >}}) put on another document. + + +scopes: public-api:read +query: | + ACCESS_TOKEN=ey1234 + curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/incomingDocumentReferences" \ + -H "Authorization: Bearer $ACCESS_TOKEN" +endpoint: + method: GET + path: /api/v1/documents/:documentId/incomingDocumentReferences +parameters: + - name: :documentId + type: integer + required: true + notes: "" + - name: ?limit + type: integer + required: false + notes: "A limit for how much published documents to retrieve. Defaults to 100. Max. 100" + - name: ?offset + type: integer + required: false + notes: "An offset into the query. Useful when getting more than 100 results (pagination)" + +responses: +- code: "200" + body: | + [ + { + "id": 4, + "references": [ + { + "id": "1", + "type": "document", + "location": "include-directive", + "componentId": "doc-1euiflvoq0", + "serviceName": "editable-teaser", + "propertyName": "article", + "componentName": "teaser-include", + "directiveName": "teaser" + } + ] + }, + { + "id": 2, + "references": [ + { + "id": "1", + "type": "document", + "location": "include-directive", + "componentId": "doc-1eu6i7l880", + "serviceName": "editable-teaser", + "propertyName": "article", + "componentName": "teaser-include", + "directiveName": "teaser" + } + ] + } + ] diff --git a/content/reference/public-api/publications/incoming_media_references.yaml b/content/reference/public-api/publications/incoming_media_references.yaml new file mode 100644 index 000000000..a3ba0d4e4 --- /dev/null +++ b/content/reference/public-api/publications/incoming_media_references.yaml @@ -0,0 +1,45 @@ +title: Get Incoming Media References for a Document +description: | + This endpoint returns all Media Library Entries which link to this document (via metadata - li-document-reference) + +scopes: public-api:read +query: | + ACCESS_TOKEN=ey1234 + curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/incomingMediaReferences" \ + -H "Authorization: Bearer $ACCESS_TOKEN" + +related: + - Foobar + +endpoint: + method: GET + path: /api/v1/documents/:documentId/incomingMediaReferences +parameters: + - name: :documentId + type: integer + required: true + notes: "" + - name: ?limit + type: integer + required: false + notes: "A limit for how much published documents to retrieve. Defaults to 100. Max. 100" + - name: ?offset + type: integer + required: false + notes: "An offset into the query. Useful when getting more than 100 results (pagination)" +responses: +- code: "200" + body: | + [ + { + "id": "98sXCahM5PEk", + "references": [ + { + "id": "3", + "type": "document", + "location": "metadata", + "propertyName": "documentLink" + } + ] + } + ] diff --git a/content/reference/public-api/publications/latest-publication-beta.md b/content/reference/public-api/publications/latest-publication-beta.md index 16d7324f5..d9a251ac9 100644 --- a/content/reference/public-api/publications/latest-publication-beta.md +++ b/content/reference/public-api/publications/latest-publication-beta.md @@ -8,193 +8,4 @@ menus: parent: Publications --- -{{< api-example - title="Get Latest Publication" - scopes="public-api:read" - beta=true ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/beta/documents/:documentId/latestPublication" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/beta/documents/:documentId/latestPublication -``` - ---parameters-- -|Name|Type|Required|Notes| -|-|-|-|-| -|:documentId|integer|x|| -|?fields|string||Filters which (comma separated) properties are included in the response. Defaults to 'systemdata,metadata,content' (no renditions).| -|?renditions|string||A comma-separated list of rendition handles. Example: `?renditions=web,json`| -|?ignoreComponentConditions|boolean||Provides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks.some lead
\nfirst paragraph
\nsecond
\nand third one. :)
" - }, - { - "handle": "mobile", - "content": { - "content": [ - { - "id": "doc-1b8i1ksh10", - "component": "head", - "identifier": "timeline.head", - "content": { - "title": "a title", - "text": "some lead" - } - }, - { - "id": "doc-1b8i1ksh20", - "component": "normal", - "identifier": "timeline.normal", - "content": { - "caption": "my caption" - }, - "styles": { - "position": "left" - } - }, - { - "id": "doc-1b8i1ksh30", - "component": "p", - "identifier": "timeline.p", - "content": { - "text": "first paragraph" - } - }, - { - "id": "doc-1b8i1me1d0", - "component": "p", - "identifier": "timeline.p", - "content": { - "text": "second paragraph" - } - } - ], - "design": { - "name": "timeline", - "version": "1.1.0" - } - } - }, - { - "handle": "app", - "error": { - "message": "Processing of Channel 'app' for document '1' failed. Detailed error message…" - } - } - ], - "references": [ - { - "id": "YbzTpusGyJtF", - "type": "language-group", - "location": "metadata", - "propertyName": "language" - } - ] -} -``` - -{{< /api-example >}} +{{< api-example-resource file="get_latest_publication_beta.yaml" >}} diff --git a/content/reference/public-api/publications/latest-publication.md b/content/reference/public-api/publications/latest-publication.md index 24398fc3f..e32f813e9 100644 --- a/content/reference/public-api/publications/latest-publication.md +++ b/content/reference/public-api/publications/latest-publication.md @@ -1,5 +1,6 @@ --- -title: Latest Publication +title: Latest Publication +identifier: Latest Publication weight: 1 renderTOC: false menus: @@ -7,184 +8,4 @@ menus: parent: Publications --- -{{< api-example - title="Get Latest Publication" - scopes="public-api:read" ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/latestPublication" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/documents/:documentId/latestPublication -``` - ---parameters-- -|Name|Type|Required|Notes| -|-|-|-|-| -|:documentId|integer|x|| -|?fields|string||Filters which (comma separated) properties are included in the response. Defaults to 'systemdata,metadata,content' (no renditions).| -|?renditions|string||A comma-separated list of rendition handles. Example: `?renditions=web,json`| -|?ignoreComponentConditions|boolean||Provides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks.some lead
\nfirst paragraph
\nsecond
\nand third one. :)
" - }, - { - "handle": "mobile", - "content": { - "content": [ - { - "id": "doc-1b8i1ksh10", - "component": "head", - "identifier": "timeline.head", - "content": { - "title": "a title", - "text": "some lead" - } - }, - { - "id": "doc-1b8i1ksh20", - "component": "normal", - "identifier": "timeline.normal", - "content": { - "caption": "my caption" - }, - "styles": { - "position": "left" - } - }, - { - "id": "doc-1b8i1ksh30", - "component": "p", - "identifier": "timeline.p", - "content": { - "text": "first paragraph" - } - }, - { - "id": "doc-1b8i1me1d0", - "component": "p", - "identifier": "timeline.p", - "content": { - "text": "second paragraph" - } - } - ], - "design": { - "name": "timeline", - "version": "1.1.0" - } - } - }, - { - "handle": "app", - "error": { - "message": "Processing of Channel 'app' for document '1' failed. Detailed error message…" - } - } - ] -} -``` - -{{< /api-example >}} +{{< api-example-resource file="get_latest_publication.yaml" >}} diff --git a/content/reference/public-api/publications/latest-publications-beta.md b/content/reference/public-api/publications/latest-publications-beta.md index f6459a46c..ffa597b9f 100644 --- a/content/reference/public-api/publications/latest-publications-beta.md +++ b/content/reference/public-api/publications/latest-publications-beta.md @@ -8,198 +8,4 @@ menus: parent: Publications --- -{{< api-example - title="Get Latest Publications" - scopes="public-api:read" - beta=true ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/beta/documents/latestPublications" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/beta/documents/latestPublications -``` - ---parameters-- -|Name|Type|Notes| -|-|-|-| -|?fields|string|Filters which (comma separated) properties are included in the response. Defaults to `systemdata,metadata,content` (no renditions).| -|?reverse|boolean|Order publications in ascending order instead of the default descending order. This is useful if you want to paginate using a time based filter.| -|?homepage|boolean|Return only the document labeled as homepage in the current project.| -|?contentTypes|string|Comma separated list of content types to use as filter.| -|?documentTypes|string|Comma separated list of document types to use as filter.some lead
\nfirst paragraph
\nsecond
\nand third one. :)
" + }, + { + "handle": "mobile", + "content": [ + { + "id": "doc-1b8i1ksh10", + "component": "head", + "identifier": "timeline.head", + "content": { + "title": "a title", + "text": "some lead" + } + }, + { + "id": "doc-1b8i1ksh20", + "component": "normal", + "identifier": "timeline.normal", + "content": { + "caption": "my caption" + }, + "styles": { + "position": "left" + } + }, + { + "id": "doc-1b8i1ksh30", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "first paragraph" + } + }, + { + "id": "doc-1b8i1me1d0", + "component": "p", + "identifier": "timeline.p", + "content": { + "text": "second paragraph" + } + } + ], + "design": { + "name": "timeline", + "version": "1.1.0" + } + }, + { + "handle": "app", + "error": { + "message": "Processing of Channel 'app' for document '1' failed. Detailed error message…" + } + } + ] diff --git a/content/reference/public-api/publications/references.md b/content/reference/public-api/publications/references.md index c7ab53eb2..e987d652a 100644 --- a/content/reference/public-api/publications/references.md +++ b/content/reference/public-api/publications/references.md @@ -7,141 +7,6 @@ menus: parent: Publications --- -{{< api-example - title="Get Incoming Publication References for a Document" - scopes="public-api:read" ->}} +{{< api-example-resource file="incoming_document_references.yaml" >}} ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/incomingDocumentReferences" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/documents/:documentId/incomingDocumentReferences -``` - ---parameters-- -|Name|Type|Required|Notes| -|-|-|-|-| -|:documentId|integer|x|| -|?limit|integer||A limit for how much published documents to retrieve. Defaults to 100. Max. 100.| -|?offset|integer||An offset into the query. Useful when getting more than 100 results (pagination).| - ---description-- - -This endpoint returns all publications which link to this document (via content or metadata) - -The example below finds a reference to ID 1 when requesting for incomingDocumentReference with ID 2. - -{{< img src="./references.png" alt="Component Property" >}} - - -##### Use Cases - -- Find publications that link to this document for cache invalidation - -##### Notes - -- Eventual Consistency of Reference because of the usage of Elasticsearch - - -##### Not Supported - -Find publications in a [Document List]({{< ref "/reference/public-api/document-lists" >}}) put on another document. - ---response-- -200 ---- ---- -```js -[ - { - "id": 4, - "references": [ - { - "id": "1", - "type": "document", - "location": "include-directive", - "componentId": "doc-1euiflvoq0", - "serviceName": "editable-teaser", - "propertyName": "article", - "componentName": "teaser-include", - "directiveName": "teaser" - } - ] - }, - { - "id": 2, - "references": [ - { - "id": "1", - "type": "document", - "location": "include-directive", - "componentId": "doc-1eu6i7l880", - "serviceName": "editable-teaser", - "propertyName": "article", - "componentName": "teaser-include", - "directiveName": "teaser" - } - ] - } -] -``` - -{{< /api-example >}} - -{{< api-example - title="Get Incoming Media References for a Document" - scopes="public-api:read" ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/incomingMediaReferences" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/documents/:documentId/incomingMediaReferences -``` - ---parameters-- -|Name|Type|Required|Notes| -|-|-|-|-| -|:documentId|integer|x|| -|?limit|integer||A limit for how much published documents to retrieve. Defaults to 100. Max. 100.| -|?offset|integer||An offset into the query. Useful when getting more than 100 results (pagination).| - ---description-- - -This endpoint returns all Media Library Entries which link to this document (via metadata - li-document-reference) - ---response-- -200 ---- ---- -```js -[ - { - "id": "98sXCahM5PEk", - "references": [ - { - "id": "3", - "type": "document", - "location": "metadata", - "propertyName": "documentLink" - } - ] - } -] -``` - -{{< /api-example >}} +{{< api-example-resource file="incoming_media_references.yaml" >}} diff --git a/content/reference/public-api/publications/renditions.md b/content/reference/public-api/publications/renditions.md index 0217a97ce..6aa6b99ed 100644 --- a/content/reference/public-api/publications/renditions.md +++ b/content/reference/public-api/publications/renditions.md @@ -7,109 +7,4 @@ menus: parent: Publications --- -{{< api-example - title="Get Specific Renditions for a Publication" - scopes="public-api:read" ->}} - ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/documents/:documentId/latestPublication/renditions/:renditionHandles" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/documents/:documentId/latestPublication/renditions/:renditionHandles -``` - ---parameters-- -|Name|Type|Required|Notes| -|-|-|-|-| -|:renditionHandles|string|x|A comma-separated list of renditions handles, e.g. "web,name".| -|?ignoreComponentConditions|boolean||Provides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks.some lead
\nfirst paragraph
\nsecond
\nand third one. :)
" - }, - { - "handle": "mobile", - "content": [ - { - "id": "doc-1b8i1ksh10", - "component": "head", - "identifier": "timeline.head", - "content": { - "title": "a title", - "text": "some lead" - } - }, - { - "id": "doc-1b8i1ksh20", - "component": "normal", - "identifier": "timeline.normal", - "content": { - "caption": "my caption" - }, - "styles": { - "position": "left" - } - }, - { - "id": "doc-1b8i1ksh30", - "component": "p", - "identifier": "timeline.p", - "content": { - "text": "first paragraph" - } - }, - { - "id": "doc-1b8i1me1d0", - "component": "p", - "identifier": "timeline.p", - "content": { - "text": "second paragraph" - } - } - ], - "design": { - "name": "timeline", - "version": "1.1.0" - } - }, - { - "handle": "app", - "error": { - "message": "Processing of Channel 'app' for document '1' failed. Detailed error message…" - } - } -] -``` - -{{< /api-example >}} +{{< api-example-resource file="publication_renditions.yaml" >}} diff --git a/content/reference/public-api/publications/search.md b/content/reference/public-api/publications/search.md index 47796aca7..cb4088d8f 100644 --- a/content/reference/public-api/publications/search.md +++ b/content/reference/public-api/publications/search.md @@ -6,281 +6,8 @@ menus: parent: Publications --- -{{< api-example - title="Search Publications" - scopes="public-api:read" ->}} +{{< api-example-resource file="search_publications.yaml" >}} ---query-- - -```bash -ACCESS_TOKEN=ey1234 -curl -k -X GET "https://server.livingdocs.io/api/v1/publications/search" \ - -H "Authorization: Bearer $ACCESS_TOKEN" -``` - ---endpoint-- -``` -GET api/v1/publications/search -``` - ---parameters-- -|Name|Type|Notes| -|-|-|-| -|?search|string|Search term to perform a full-text search with. For exact word matches use ", e.g. 'search="Ukulele"'| -|?contentTypes|string|Comma separated list of content-types for which documents should be found. Content types are concatenated with OR. Example: 'regular,author'| -|?categories|string|Comma separated list of category ids for which documents should be found. Categories are concatenated with OR. Example: 'sport,fashion'| -|?languages|string|Comma separated list of languages for which documents should be found. Languages are concatenated with OR. Example: 'en,de'| -|?languageGroupId|string|A GroupId used to fetch all translations of a document Using the ?languages param a document in a specific language can be fetched. Example: '?languageGroupId=47?language=de'| -|?filters|string|A JSON string which follows the [search filters query DSL]({{< ref "#search-filters" >}}).| -|?sort|string|Comma separated list of sort properties. Any of the [Sort Fields]({{< ref "#sort-fields" >}}) can be used.++{{ else }} ++ {{ $info := resources.Get (printf "svg/%s.svg" .AlertType) | fingerprint }} + + {{ with .AlertTitle }} + {{ . }} + {{ else }} + {{ or (i18n .AlertType) (title .AlertType) }} + {{ end }} +
+ {{ .Text }} +
+ {{ .Text }} ++{{ end }} diff --git a/themes/hugo-docs/layouts/shortcodes/api-example-resource.html b/themes/hugo-docs/layouts/shortcodes/api-example-resource.html new file mode 100644 index 000000000..4574e3ff7 --- /dev/null +++ b/themes/hugo-docs/layouts/shortcodes/api-example-resource.html @@ -0,0 +1,132 @@ +{{- $yamlPath := .Get "file" -}} +{{ $PAGE := .Page }} +{{ if (ne $PAGE.BundleType "branch") }}{{ $PAGE = .Page.Parent }}{{ end }} +{{- $example := $PAGE.Resources.Get $yamlPath | transform.Unmarshal -}} + +
Name | +Type | +Required | +Notes | +
---|---|---|---|
{{ .name }} | +{{ .type }} | +{{ if .required }}x{{ end }} | +{{ .notes | $PAGE.RenderString }} | +