See all operations
POST: projects/{project_id}/documents/{document_id}/versions/file?make_current={make_current}
Description
Adds a new version to a file attachment in the system
How to Execute
To access this REST web service, you need to use the following URL (make sure to replace any parameters (eg {project_id}) with the relevant value (eg 1):
https://api.inflectra.com/spira/services/v6_0/RestService.svc/projects/{project_id}/documents/{document_id}/versions/file?make_current={make_current}
Request Parameters
Name
|
Description
|
project_id
|
The id of the current project
|
document_id
|
The id of the document that we're adding this new version to
|
make_current
|
Should we make this the current version
|
Request Body
Property
|
Description
|
BinaryData
|
The file data base64 encoded if using the REST service
|
AttachmentVersionId
|
The id of the document version
|
AttachmentId
|
The id of the document
|
AuthorId
|
The id of the user that uploaded the version
If no value is provided, the authenticated user is used
|
FilenameOrUrl
|
The filename of the file (if a file attachment) or the full URL if a URL attachment
|
Description
|
The description of the attachment version
|
UploadDate
|
The date/time the attachment version was uploaded
|
Size
|
The size of the attachment version in bytes
Pass 0 for a URL attachment
|
VersionNumber
|
The version number
|
AuthorName
|
The display name of the user that uploaded the attachment version
|
<RemoteDocumentVersionFile xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v6_0.DataObjects">
<AttachmentId>0</AttachmentId>
<AttachmentVersionId i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<Description i:nil="true" />
<FilenameOrUrl i:nil="true" />
<Size>0</Size>
<UploadDate>0001-01-01T00:00:00</UploadDate>
<VersionNumber i:nil="true" />
<BinaryData i:nil="true" />
</RemoteDocumentVersionFile>
{"BinaryData":null,
"AttachmentVersionId":null,
"AttachmentId":0,
"AuthorId":null,
"FilenameOrUrl":null,
"Description":null,
"UploadDate":"0001-01-01T00:00:00",
"Size":0,
"VersionNumber":null,
"AuthorName":null}
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
|
AttachmentVersionId
|
The id of the document version
|
AttachmentId
|
The id of the document
|
AuthorId
|
The id of the user that uploaded the version
If no value is provided, the authenticated user is used
|
FilenameOrUrl
|
The filename of the file (if a file attachment) or the full URL if a URL attachment
|
Description
|
The description of the attachment version
|
UploadDate
|
The date/time the attachment version was uploaded
|
Size
|
The size of the attachment version in bytes
Pass 0 for a URL attachment
|
VersionNumber
|
The version number
|
AuthorName
|
The display name of the user that uploaded the attachment version
|
<RemoteDocumentVersion xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v6_0.DataObjects">
<AttachmentId>0</AttachmentId>
<AttachmentVersionId i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<Description i:nil="true" />
<FilenameOrUrl i:nil="true" />
<Size>0</Size>
<UploadDate>0001-01-01T00:00:00</UploadDate>
<VersionNumber i:nil="true" />
</RemoteDocumentVersion>
{"AttachmentVersionId":null,
"AttachmentId":0,
"AuthorId":null,
"FilenameOrUrl":null,
"Description":null,
"UploadDate":"0001-01-01T00:00:00",
"Size":0,
"VersionNumber":null,
"AuthorName":null}