Skip to content

DocumentLastViewed

Rob Prince edited this page Mar 2, 2016 · 7 revisions

Summary

When a user views a document, it is recorded in the documents activity trail. This API allows users to determine which version they last viewed of a document.
If they have the Difference feature enabled, they will receive a difference link that will allow them to view the changes.

Status

Operation Status
Get last viewed Beta

Operations

Get last viewed

The document resource will advertise a link "last-viewed". Follow this link to determine when you last viewed the document. The user is determined from the Authorization header given in the request.

Example

Request

GET documents/15538/versions/last-viewed HTTP/1.1
Accept: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty

Response

HTTP/1.1 200 NO CONTENT
Content-Type: application/vnd.huddle.data+xml

{
 "links": [
    {
      "rel": "self",
      "href": "https://my.huddle.local/apigateway/files/documents/15538/versions/last-viewed"
    },
    {
      "rel": "difference",
      "href": "https://my.huddle.local/apigateway/files/documents/15538/versions/18067/difference/18069"
    }
  ],
  "hasViewedLatestVersion": false,
  "viewedOn": "Tue, 01 Mar 2016 21:07:47 GMT"
  "version": {
   "links": [
    {
      "rel": "self",
      "href": "https://my.huddle.local/apigateway/files/documents/15538/version/18064"
    },
    "versionNumber": 3,
    "createdDate": "Tue, 01 Mar 2016 16:41:53 GMT",
    "createdBy": {
      "name": "frootymcnooty",
      "email": [email protected]",
      "rel": "creator",
      "links": [
        {
          "rel": "self",
          "href": "https://my.huddle.local/apigateway/users/0"
        },
        {
          "rel": "avatar",
          "href": "https://my.huddle.local/apigateway/files/users/0/avatar?h=4_3FdWZOVRgzSbvZUfniOo7AspfSkgv5eTJibzwMHts"
        },
        {
          "rel": "alternate",
          "href": "https://my.huddle.local/user/frootymcnooty",
          "type": "text/html"
        }
      ]
    }
  }
}
Classic
Clone this wiki locally