PublishDocument - Huddle/huddle-apis GitHub Wiki
Documents can be published publicly or privately. A published document has a unique URL that can be shared with people who do not have access to the document in Huddle.
If a document can be published, it will advertise a link with the @rel value publish. Submitting an empty POST to this endpoint will publish the latest version of the document.
If the Publish request is successful, the response will be a 202 accepted. A successful response will include a Link header with a rel value of progress. This progress link will point to a monitoring resource. A deprecated monitor link will also be advertised.
POST .../files/documents/123/publications HTTP/1.1
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 202 Accepted
Link: <https://.../publishing/progress/660107d3-b06d-4972-9cfc-8c5ac1e381e5>;rel="progress"
Link: <https://.../files/documents/123/publications>;rel="monitor"
The PublishingProgress
resource will contain information about the State of an ongoing Publishing request.
The endpoint will advertise a bookmark link as soon as available.
It will also advertise a link to publications when the status is Done
. The client should then follow this link to refresh its view of the document publications.
GET /publishing/progress/660107d3-b06d-4972-9cfc-8c5ac1e381e5 HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<publishingProgress xmlns="http://schema.huddle.net/2011/02/">
<link rel="self" href="publishing/progress/660107d3-b06d-4972-9cfc-8c5ac1e381e5" />
<link rel="bookmark" href="http://public.published.link/123" />
<link rel="publications" href="documents/123/publications" />
<status>Done</status>
</publishingProgress>
Name | Description |
---|---|
Status | The publication progress status: NotStarted , InProgress , Done , Failed
|
Unpublish an already published document. The document will no longer be available publicly or privately.
Response contains a link to re-publish the document should that be desired immediately after unpublishing.
DELETE .../files/documents/123/publications HTTP/1.1
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 202 Accepted
Link: <https://.../files/documents/123/publications>;rel="self"
Link: <https://.../files/documents/123/publications>;rel="publish"
The document resource will advertise a link with @rel value of publications if the document has been published. To retrieve the history of the publications for the document as well as its public link, GET the publication URI. "publish" and "unpublish" links will also be available if user has permission to publish/unpublish where appropriate.
GET /documents/123/publications HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<documentPublication xmlns="http://schema.huddle.net/2011/02/">
<link rel="self" href="documents/123/publications" />
<link rel="parent" href="documents/123" />
<link rel="bookmark" href="http://public.published.link/123" />
<link rel="publish" href="documents/123/publications" />
<link rel="unpublish" href="documents/123/publications" />
<publications>
<publication>
<actor name="Peter Gibson" email="[email protected]" rel="publisher">
<link rel="self" href="..." />
<link rel="avatar" href="..." type="image/jpg" />
<link rel="alternate" href="..." type="text/html" />
</actor>
<publishedDate>2007-10-10T09:02:17Z</publishedDate>
<publishingstate>PublishInProgress</publishingstate>
<documentVersion>
<link rel="self" href="documents/123/version/543" />
<version>2</version>
<note>new note</note>
</documentVersion>
</publication>
<publication>
<actor name="Jimmy Snake" email="[email protected]" rel="publisher">
<link rel="self" href="..." />
<link rel="avatar" href="..." type="image/jpg" />
<link rel="alternate" href="..." type="text/html" />
</actor>
<publishedDate>2007-10-10T09:02:17Z</publishedDate>
<publishingstate>PublishInProgress</publishingstate>
<documentVersion>
<link rel="self" href="documents/123/version/542" />
<version>1</version>
<note>new note</note>
</documentVersion>
</publication>
</publications>
</documentPublication>
Name | Description |
---|---|
PublishingState | The publishing status of the published version: NotPublished , PublishInProgress , Published , UnpublishInProgress
|
This information is retrieved from the PublishedDocuments endpoint
This list is retrieved from the PublishedDocuments endpoint
This list is retrieved from the PublishedDocuments endpoint