GetDocument()

The GetDocument() command returns a document attachment as a Base64 encoded binary string.

To get a list of documents attached to an asset, see GetAttachments().

  • Quota: 6
Table 1. Parameters
Parameter Type Max Length Required Description
apiToken string 20 Y Your API security token configured in Field View.
assetId integer Y The ID of the asset.
documentId integer Y The ID in <Attachment> object from GetAttachments, where <Type> = “Document.”
Table 2. Returns
Field Type Description
GetDocumentResponse GetDocumentResponse Returns a single document attachment object. Note that <Media> contains a Base64 encoded binary string. Document types can be determined by the returned <MimeType>.

Note: Dates are in UTC.

<GetDocumentResponse>
         <GetDocumentResult>
            <DocumentResponse>
               <DocumentId>12265</DocumentId>
               <DocumentName>Asset C.docx</DocumentName>
               <DocumentType>UnKnown</DocumentType>
               <MimeType>application/vnd.openxmlformats-officedocument.word</MimeType>
               <DocumentFile>[BASE64 ENCODED BINARY STRING]</DocumentFile>
               <Date>2018-04-03T18:12:17.397</Date>
               <Forename>TEST</Forename>
               <Surname>USER</Surname>
               <Status>
                  <Code>SUCCESS</Code>
                  <Message>Success.</Message>
               </Status>
            </DocumentResponse>
         </GetDocumentResult>
      </GetDocumentResponse>