See all operations
GET: projects/{project_id}/documents/{document_id}
Description
Retrieves a single project document by its id
1) For files it does not include the raw file data, you need to use Document_OpenById
2) It also retrieves the list of document versions
How to Execute
To access this REST web service, you need to use the following URL:
https://api.inflectra.com/Spira/Services/v4_0/RestService.svc/projects/{project_id}/documents/{document_id}
Request Parameters
Name
|
Description
|
project_id
|
The id of the current project
|
document_id
|
The id of the attachment to retrieve
|
Request Body
Return Data
The JSON and XML examples below show the shape of one entry that will be returned. It does not show an example of how that entry will be populated.
Property
|
Description
|
AttachmentId
|
The id of the attachment
|
AttachmentTypeId
|
The id of the attachment type
File = 1,
URL = 2
|
ProjectAttachmentTypeId
|
The id of the attachment type relative to the current project
|
ProjectAttachmentFolderId
|
The id of the attachment folder id for the current project
|
ArtifactTypeId
|
The id of the type of artifact it's attached to
Requirement = 1,
TestCase = 2,
Incident = 3,
Release = 4,
TestRun = 5,
Task = 6,
TestStep = 7,
TestSet = 8
|
ArtifactId
|
The id of the artifact it's being attached to
|
AuthorId
|
The id of the user that uploaded the attachment
If no value is provided, the authenticated user is used
|
EditorId
|
The id of the user that edited the document
|
FilenameOrUrl
|
The filename of the file (if a file attachment) or the full URL if a URL attachment
|
Description
|
The description of the attachment
|
UploadDate
|
The date/time the attachment was uploaded
|
EditedDate
|
The date/time the attachment was last edited
|
Size
|
The size of the attachment in bytes
Pass 0 for a URL attachment
|
CurrentVersion
|
The version name of the current attachment
|
Tags
|
The list of meta-tags that should be associated with the attachment
|
Versions
|
The list of document versions
|
ProjectAttachmentTypeName
|
The display name of the attachment type relative to the current project
This is not whether it's a file or url, but the project-specific classification
|
AttachmentTypeName
|
The display name of the attachment type (i.e. whether it's a file or url)
|
AuthorName
|
The display name of the user that uploaded the attachment
|
EditorName
|
The display name of the user that edited the document
|
<RemoteDocument xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v4_0.DataObjects">
<ArtifactId i:nil="true" />
<ArtifactTypeId i:nil="true" />
<AttachmentId i:nil="true" />
<AttachmentTypeId>0</AttachmentTypeId>
<AttachmentTypeName i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<CurrentVersion i:nil="true" />
<Description i:nil="true" />
<EditedDate>0001-01-01T00:00:00</EditedDate>
<EditorId i:nil="true" />
<EditorName i:nil="true" />
<FilenameOrUrl i:nil="true" />
<ProjectAttachmentFolderId i:nil="true" />
<ProjectAttachmentTypeId i:nil="true" />
<ProjectAttachmentTypeName i:nil="true" />
<Size>0</Size>
<Tags i:nil="true" />
<UploadDate>0001-01-01T00:00:00</UploadDate>
<Versions i:nil="true" />
</RemoteDocument>
{"ArtifactId":null,
"ArtifactTypeId":null,
"AttachmentId":null,
"AttachmentTypeId":0,
"AttachmentTypeName":null,
"AuthorId":null,
"AuthorName":null,
"CurrentVersion":null,
"Description":null,
"EditedDate":"\/Date(-62135578800000-0500)\/",
"EditorId":null,
"EditorName":null,
"FilenameOrUrl":null,
"ProjectAttachmentFolderId":null,
"ProjectAttachmentTypeId":null,
"ProjectAttachmentTypeName":null,
"Size":0,
"Tags":null,
"UploadDate":"\/Date(-62135578800000-0500)\/",
"Versions":null}