Obtaining the attributes of a document
On this page
Use this API method to obtain the attributes (metadata) of a specific document. The result is in JSON format and contains the list of attributes along with their values.
Request URL
The request URL takes the following form:
GET <ROOT>/rest/stonikbyte-documents-api/1.0/document/{documentID}
Parameters
Parameter | Description |
---|---|
{documentID} | The Id (key) of the document |
A successful response
An HTTP 200 status response indicates a successful request. Here is an example of data returned in JSON format:
{
"id": 4,
"type": "File",
"jiraProjectId": 10000,
"parentId": 1,
"parentType": "Folder",
"title": "Market Requirements Document",
"originalFileName": "mrd.docx",
"originalFileExtension": "docx",
"fileSize": 1541093,
"target": "5803722147480494253",
"description": "This document describes the market requirements.",
"dateCreated": 1483010434245,
"createdBy": "admin",
"currentRevision": "1.0",
"currentRevisionDescription": "First Draft",
"currentRevisionAuthors": "",
"dateUpdated": 1483010815614,
"updatedBy": "admin"
}
Depending on the document type, one of more attributes will be present in the result. Only the attributes with a value set will be returned.
Data | Description | Example |
---|---|---|
id | The ID the document | 4 |
type | The type of the document. | "File" |
jiraProjectId | The ID of the Jira project the document belongs to | 10000 |
parentId | The ID of the folder or Jira project where the document is located | 1 |
parentType | The type of the parent. | "Folder" |
title | The Title of the document | "Market Requirements Document" |
originalFileName | The name of the attached file. Is applicable only for documents of type File. | "mrd.docx" |
originalFileExtension | The extension of the attached file. Is applicable only for documents of type File. | "docx" |
fileSize | The size of the attached file in Bytes. Is applicable only for documents of type File. | |
target | The internal indentifier of the attached file for documents of type File. Or, the target URL for documents of type URL. | |
description | The Description of the document. | "This document describes the market requirements." |
dateCreated | The Date when the document was created in number of milliseconds since January 1st, 1970, UTC. | |
createdBy | The key of the Jira user who created the document. | "admin" |
currentRevision | The Current Revision field of the document as entered during last update or during creation. | "1.0" |
currentRevisionDescription | The Revision Notes field of the document as entered during last update or during creation. | "First draft" |
currentRevisionAuthors | The Revision Author(s) field of the document as entered during last update or during creation. | "John Smith" |
currentRevisionDate | The Revision Date field of the document. | "2016-12-25" |
dateUpdated | The Date when the most recent update was done in number of milliseconds since January 1st, 1970, UTC. | |
updatedBy | The key of the Jira user who performed the most recent update on the document. | "admin" |
Error Response
If the REST call fails, the service returns one of the following HTTP statuses:
HTTP Status Code | Description |
---|---|
401 Unauthorized | Returned for unauthenticated requests or in case of invalid Documents app license |
403 Forbidden | If the user does not have View permissions over the document |