Community articleDocument GET8.5.3 UP1
Added by IBM contributorIBM | Edited by IBM contributorDave Delay on March 14, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Gets information about a document in a database.

Defined in: Document resource

Input
Method URI Description
GET /{database}/api/data/documents/unid/{docunid} Gets information about a document in a database.
Name Type Optional Description
database
string No Path name of a database on the server relative to the data directory.
docunid
string No Universal ID of a document in the database.
Name Type Optional Description
compact
boolean Yes Controls compacting of the JSON output. Compacting removes extraneous white space.
hidden
boolean Yes When true, emits supported Lotus NotesĀ® fields (beginning with $), for example, "$UpdatedBy":"CN=Admin/O=Peaks".
markRead
boolean Yes When true, disables updating the read marks on the server.
multipart
9.0
boolean Yes When false, formats rich text as a single HTML part rather than multipart. The default value is true.
strongtype
boolean Yes When true, displays date-time items as objects with type and data elements. See the examples. Rich text items always use strongtype format.
Name Type Optional Description
If-Modified-Since
9.0
date Yes Date and time in RFC 1123 time format, for example, Tue, 23 Aug 2011 21:35:18 GMT, as previously returned in the Last-Modified response header for the same document
Output
Content Type: application/json
Use the table below that represents the returned fields:
Name Type Optional Description
@modified
date No The last modification date of the document.
@unid
string No The universal ID of the document.
@href
string No URL for the document.
{name of an item on the document}
Object No Value of the item. See examples.
Code Description
200
OK. Indicates that the request was processed successfully.
304
The document hasn't been modified since the date in the request's If-Modified-Since header.
Examples
This request gets information on a document. The response shows string, date, numeric, and rich text data.
GET /XPagesExt.nsf/api/data/documents/unid/5D006566E919779E852578B7004A6019

Response returned by the server
{
  "LastName":"Doe",
  "Body": {
    "content": [
      {
        "contentType":"multipart\/alternative; Boundary=\"0__=0ABBF337DFDA85C48f9e8a93df938690918c0ABBF337DFDA85C4\"",
        "contentDisposition":"inline"
      },
      {
        "contentType":"text\/plain; charset=US-ASCII",
        "boundary":"--0__=0ABBF337DFDA85C48f9e8a93df938690918c0ABBF337DFDA85C4",
        "data":"Mostly sales. Some marketing."
      },
      {
        "contentType":"text\/html; charset=US-ASCII",
        "boundary":"--0__=0ABBF337DFDA85C48f9e8a93df938690918c0ABBF337DFDA85C4",
        "data":"<html><body><font size=\"2\" face=\"sans-serif\">Mostly <\/font><font size=\"2\" face=\"sans-serif\"><b>sales<\/b><\/font><font size=\"2\" face=\"sans-serif\">. Some <\/font><font size=\"2\" face=\"sans-serif\"><i>marketing<\/i><\/font><font size=\"2\" face=\"sans-serif\">.<\/font><\/body><\/html>",
        "contentDisposition":"inline"
      }
    ],
    "type":"multipart"
  },
  "@form":"Contact",
  "@created":"2011-06-29T15:30:34Z",
  "@authors": [
"Anonymous",
"CN=rperronadmin\/O=rtest"
  ],
  "@modified":"2011-08-21T15:21:51Z",
  "Number":4.4,
  "@href":"\/XPagesExt.nsf\/api\/data\/documents\/unid\/5BCE1CAEEBA4F309852578BE0055327B",
  "City":"Trenton",
  "@noteid":"922",
  "Date": [
"2011-07-21T20:21:00Z",
"2011-08-01T14:38:00Z"
  ],
  "@unid":"5BCE1CAEEBA4F309852578BE0055327B",
  "FirstName":"John",
  "EMail":"jdoe@acme.com"
}
This request gets information on the same document with strongtype=true.
GET /XPagesExt.nsf/api/data/documents/unid/5D006566E919779E852578B7004A6019?strongtype=true

Response returned by the server
{
  "LastName":"Doe",
  "Body": {
    "content": [
      {
        "contentType":"multipart\/alternative; Boundary=\"0__=0ABBF337DFDAE7998f9e8a93df938690918c0ABBF337DFDAE799\"",
        "contentDisposition":"inline"
      },
      {
        "contentType":"text\/plain; charset=US-ASCII",
        "boundary":"--0__=0ABBF337DFDAE7998f9e8a93df938690918c0ABBF337DFDAE799",
        "data":"Mostly sales. Some marketing."
      },
      {
        "contentType":"text\/html; charset=US-ASCII",
        "boundary":"--0__=0ABBF337DFDAE7998f9e8a93df938690918c0ABBF337DFDAE799",
        "data":"<html><body><font size=\"2\" face=\"sans-serif\">Mostly <\/font><font size=\"2\" face=\"sans-serif\"><b>sales<\/b><\/font><font size=\"2\" face=\"sans-serif\">. Some <\/font><font size=\"2\" face=\"sans-serif\"><i>marketing<\/i><\/font><font size=\"2\" face=\"sans-serif\">.<\/font><\/body><\/html>",
        "contentDisposition":"inline"
      }
    ],
    "type":"multipart"
  },
  "@form":"Contact",
  "@created": {
    "type":"datetime",
    "data":"2011-06-29T15:30:34Z"
  },
  "@authors": [
"Anonymous",
"CN=rperronadmin\/O=rtest"
  ],
  "@modified": {
    "type":"datetime",
    "data":"2011-08-21T15:21:51Z"
  },
  "Number":4.4,
  "@href":"\/XPagesExt.nsf\/api\/data\/documents\/unid\/5BCE1CAEEBA4F309852578BE0055327B",
  "City":"Trenton",
  "@noteid":"922",
  "Date": {
    "type":"datetime",
    "data": [
"2011-07-21T20:21:00Z",
"2011-08-01T14:38:00Z"
    ]
  },
  "@unid":"5BCE1CAEEBA4F309852578BE0055327B",
  "FirstName":"John",
  "EMail":"jdoe@acme.com"
}
This example shows the response for a document whose rich text Body item contains an attachment and a embedded image.
GET /XPagesExt.nsf/api/data/documents/unid/9B2E5F135D47387D852578F4004F8EDE

Response returned by the server
{
  "LastName":"Bloomberg",
  "Body": {
    "content": [
      {
        "contentType":"multipart\/mixed; Boundary=\"0__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36\""
      },
      {
        "contentType":"multipart\/related; Boundary=\"1__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36\"",
        "boundary":"--0__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36"
      },
      {
        "contentType":"multipart\/alternative; Boundary=\"2__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36\"",
        "boundary":"--1__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36"
      },
      {
        "contentType":"text\/plain; charset=US-ASCII",
        "contentTransferEncoding":"quoted-printable",
        "boundary":"--2__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36",
        "data":"\r\nJust sales.\r\nAttachment: (See attached file: image.gif)\r\nLink: (Document link: XPages Extension Library Demo)=\r\n"
      },
      {
        "contentType":"text\/html; charset=US-ASCII",
        "contentTransferEncoding":"quoted-printable",
        "boundary":"--2__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36",
        "data":"<html><body><font size=3D\"3\" face=3D\"serif\">Just <\/font><font size=3D\"3=\r\n\" face=3D\"serif\"><b>sales<\/b><\/font><font size=3D\"3\" face=3D\"serif\">.<\/=\r\nfont><br>\r\n<font size=3D\"3\" face=3D\"serif\">Attachment: <\/font><i>(See attached fil=\r\ne: image.gif)<\/i><br>\r\n<font size=3D\"3\" face=3D\"serif\">Link: <\/font><a href=3D\"Notes:\/\/IBM-Z0S=\r\nHI2LW4CZ\/852578BD005519C2\/CD40A953ABDE036A8525786500660C27\/B36433FCF346=\r\n069E852578B7004AAD09\"><img src=3D\"cid:2__=3D0ABBF337DFD4CB368f9e8a93df9=\r\n3869091@local\" border=3D\"0\" alt=3D\"XPages Extension Library Demo\"><\/a><=\r\n\/body><\/html>=\r\n\r\n",
        "contentDisposition":"inline"
      },
      {
        "contentType":"image\/gif; name=\"doclink.gif\"",
        "contentID":"<2__=0ABBF337DFD4CB368f9e8a93df93869091@local>",
        "contentTransferEncoding":"base64",
        "boundary":"--1__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36",
        "data":"R0lGODlhDAAOALMAAAAAAP\/\/\/7q6w7m5wrW1vf7+\/u\/v7+Hh4dLS0sDAwLu7u7KysqKiooCAgP\/\/\r\n\/wAAACH5BAEAAA4ALAAAAAAMAA4AAARC0MkGmrwXhKbqwtoWBAslAV4zjsBJNuraOuEqu\/Z4zPV6\r\nBLzcDxH0BRC7BK2gOx6IiwWqsXAiAVFJyfPEKjFb1CcCADs=\r\n\r\n",
        "contentDisposition":"inline; filename=\"doclink.gif\""
      },
      {
        "contentType":"image\/gif; name=\"image.gif\"",
        "contentID":"<1__=0ABBF337DFD4CB368f9e8a93df93869091@local>",
        "contentTransferEncoding":"base64",
        "boundary":"--0__=0ABBF337DFD4CB368f9e8a93df938690918c0ABBF337DFD4CB36",
        "data":"R0lGODdhIAAgAIMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD\/AP\/\/AAAA\/\/8A\/wD\/\r\n\/\/\/\/\/ywAAAAAIAAgAAAE9BDIOY+9GNMNkPdSJmbSB3bbo65su25ICbh03aKordN4vP+v2AQITBGL\r\noZ1hydwdABbbUuAQWJo1TM0g6ApUDkdDwMheaFxBo\/GgLhyGxpKmbR24jcVD\/3D0qwwHLnUseAZ+\r\nYH9eBoNnLYcLDQ4DCn6WXmV2joVhDw0KY2FhBWOZLIQrh21qrF9wBWSNUY9hrV5wVQ2mK6gqqrle\r\nVHAGBbsqvb6Wnl1hTIGygi6Hh1VWw0vGx5stDLhjd85mszQMDIcF4OU2FlA6B+Xwz+tDRz9G9TUU\r\nPvj5Qvv8LnrMABjQ370jMEqYCDGiocIPHCg0FBFRQgQAOw==\r\n\r\n",
        "contentDisposition":"attachment; filename=\"image.gif\""
      }
    ],
    "type":"multipart"
  },
  "@form":"Contact",
  "@created":"2011-08-22T14:28:59Z",
  "@authors": [
"Anonymous",
"CN=rperronadmin\/O=rtest"
  ],
  "@modified":"2011-08-23T21:35:18Z",
  "Number":1.75,
  "City":"New York City",
  "@href":"\/XPagesExt.nsf\/api\/data\/documents\/unid\/9B2E5F135D47387D852578F4004F8EDE",
  "@noteid":"92E",
  "MIME_Version":"1.0",
  "Date": [
"2011-08-21T20:21:00Z",
"2011-08-01T14:38:00Z"
  ],
  "@unid":"9B2E5F135D47387D852578F4004F8EDE",
  "FirstName":"Barney",
  "EMail":"bb@acme.com"
}