Obtaining the attributes of a previous document version
On this page
Use this API method to obtain the attributes (metadata) of a specific document version. 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}/version/{versionNumber}
Parameters
Parameter | Description |
---|---|
{documentID} | The Id (key) of the document |
{versionNumber} | The version number |
A successful response
An HTTP 200 status response indicates a successful request. Here is an example of data returned in JSON format:
{
"versionNumber": 2,
"title": "Market Requirements Document",
"originalFileName": "mrd.docx",
"originalFileExtension": "docx",
"fileSize": 1541093,
"target": "5803722147480494253",
"description": "This document describes the market requirements.",
"currentRevision": "1.0",
"revisionAuthor": "John Smith",
"revisionDate": "2019-01-20 00:00:00.0",
"revisionNotes": "First Draft",
"createdBy":"admin",
"dateCreated": "2019-01-22 06:30:36.0"
}
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 |
---|---|---|
versionNumber | The version number | 2 |
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." |
currentRevision | The Current Revision field of the document as entered during last update or during creation. | "1.0" |
revisionAuthor | The Revision Author(s) field of the document as entered during last update or during creation. | "John Smith" |
revisionNotes | The Revision Notes field of the document as entered during last update or during creation. | "First draft" |
revisionDate | The Revision Date field of the document. | "2019-01-20 00:00:00.0" |
createdBy | The Jira user who actually created this version in the Jira system | "admin" |
dateCreated | The date when the version was created in the Jira system | "2019-01-22 06:30:36.0" |
You can form links to download the file of a specific document version by using the documentKey and versionNumber. The link is in form:
https:/ /MY_JIRA_BASE_URL/plugins/servlet/StonikByte/VersionOfDocument?documentId=519&versionNumber=2
In this example, the file attached to version 2 of the document 519 will be downloaded.
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 |
Â