See all operations
POST: projects/{project_id}/documents/file
Description
Adds a new document (file) into the system and associates it with the provided artifact (optional)
and project folder/type (optional)
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/v7_0/RestService.svc/projects/{project_id}/documents/file
Request Parameters
Name
|
Description
|
project_id
|
The id of the current project (required)
|
Request Body
Property
|
Description
|
BinaryData
|
The file data base64 encoded if using the REST service
|
AttachmentId
|
The id of the attachment
|
AttachmentTypeId
|
The id of the attachment type
File = 1,
URL = 2
|
DocumentTypeId
|
The id of the document type relative to the current project template
|
DocumentStatusId
|
The id of the document status relative to the current project template
|
ProjectAttachmentFolderId
|
The id of the attachment folder id for the current project
|
AttachedArtifacts
|
The list of artifacts the document is 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
|
AuthorGuid
|
The guid of the author.
|
EditorGuid
|
The guid of the editor.
|
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
|
Versions
|
The list of document versions
|
DocumentTypeName
|
The display name of the attachment type relative to the current project template
This is not whether it's a file or url, but the project-template specific classification
|
DocumentStatusName
|
The display name of the document status relative to the current project template
|
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
|
ProjectId
|
The id of the project that the artifact belongs to
|
ProjectGuid
|
The guid of the project that the artifact belongs to
|
ConcurrencyDate
|
The datetime used to track optimistic concurrency to prevent edit conflicts
|
CustomProperties
|
The list of associated custom properties/fields for this artifact
|
Tags
|
The list of meta-tags that should be associated with the artifact
|
Guid
|
The unique identifier for the artifact
|
<RemoteDocumentFile xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v7_0.DataObjects">
<ArtifactTypeId>0</ArtifactTypeId>
<ConcurrencyDate>0001-01-01T00:00:00</ConcurrencyDate>
<CustomProperties i:nil="true" />
<Guid i:nil="true" />
<IsAttachments>false</IsAttachments>
<ProjectGuid i:nil="true" />
<ProjectId>0</ProjectId>
<Tags i:nil="true" />
<AttachedArtifacts i:nil="true" />
<AttachmentId i:nil="true" />
<AttachmentTypeId>0</AttachmentTypeId>
<AttachmentTypeName i:nil="true" />
<AuthorGuid i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<CurrentVersion i:nil="true" />
<Description i:nil="true" />
<DocumentStatusId i:nil="true" />
<DocumentStatusName i:nil="true" />
<DocumentTypeId i:nil="true" />
<DocumentTypeName i:nil="true" />
<EditedDate>0001-01-01T00:00:00</EditedDate>
<EditorGuid i:nil="true" />
<EditorId i:nil="true" />
<EditorName i:nil="true" />
<FilenameOrUrl i:nil="true" />
<ProjectAttachmentFolderId i:nil="true" />
<Size>0</Size>
<UploadDate>0001-01-01T00:00:00</UploadDate>
<Versions i:nil="true" />
<BinaryData i:nil="true" />
</RemoteDocumentFile>
{"BinaryData":null,
"AttachmentId":null,
"AttachmentTypeId":0,
"DocumentTypeId":null,
"DocumentStatusId":null,
"ProjectAttachmentFolderId":null,
"AttachedArtifacts":null,
"AuthorId":null,
"EditorId":null,
"AuthorGuid":null,
"EditorGuid":null,
"FilenameOrUrl":null,
"Description":null,
"UploadDate":"0001-01-01T00:00:00",
"EditedDate":"0001-01-01T00:00:00",
"Size":0,
"CurrentVersion":null,
"Versions":null,
"DocumentTypeName":null,
"DocumentStatusName":null,
"AttachmentTypeName":null,
"AuthorName":null,
"EditorName":null,
"ProjectId":0,
"ProjectGuid":null,
"ArtifactTypeId":0,
"ConcurrencyDate":"0001-01-01T00:00:00",
"CustomProperties":null,
"IsAttachments":false,
"Tags":null,
"Guid":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
|
AttachmentId
|
The id of the attachment
|
AttachmentTypeId
|
The id of the attachment type
File = 1,
URL = 2
|
DocumentTypeId
|
The id of the document type relative to the current project template
|
DocumentStatusId
|
The id of the document status relative to the current project template
|
ProjectAttachmentFolderId
|
The id of the attachment folder id for the current project
|
AttachedArtifacts
|
The list of artifacts the document is 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
|
AuthorGuid
|
The guid of the author.
|
EditorGuid
|
The guid of the editor.
|
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
|
Versions
|
The list of document versions
|
DocumentTypeName
|
The display name of the attachment type relative to the current project template
This is not whether it's a file or url, but the project-template specific classification
|
DocumentStatusName
|
The display name of the document status relative to the current project template
|
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
|
ProjectId
|
The id of the project that the artifact belongs to
|
ProjectGuid
|
The guid of the project that the artifact belongs to
|
ArtifactTypeId
|
The type of artifact that we have
|
ConcurrencyDate
|
The datetime used to track optimistic concurrency to prevent edit conflicts
|
CustomProperties
|
The list of associated custom properties/fields for this artifact
|
IsAttachments
|
Does this artifact have any attachments?
|
Tags
|
The list of meta-tags that should be associated with the artifact
|
Guid
|
The unique identifier for the artifact
|
<RemoteDocument xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Inflectra.SpiraTest.Web.Services.v7_0.DataObjects">
<ArtifactTypeId>0</ArtifactTypeId>
<ConcurrencyDate>0001-01-01T00:00:00</ConcurrencyDate>
<CustomProperties i:nil="true" />
<Guid i:nil="true" />
<IsAttachments>false</IsAttachments>
<ProjectGuid i:nil="true" />
<ProjectId>0</ProjectId>
<Tags i:nil="true" />
<AttachedArtifacts i:nil="true" />
<AttachmentId i:nil="true" />
<AttachmentTypeId>0</AttachmentTypeId>
<AttachmentTypeName i:nil="true" />
<AuthorGuid i:nil="true" />
<AuthorId i:nil="true" />
<AuthorName i:nil="true" />
<CurrentVersion i:nil="true" />
<Description i:nil="true" />
<DocumentStatusId i:nil="true" />
<DocumentStatusName i:nil="true" />
<DocumentTypeId i:nil="true" />
<DocumentTypeName i:nil="true" />
<EditedDate>0001-01-01T00:00:00</EditedDate>
<EditorGuid i:nil="true" />
<EditorId i:nil="true" />
<EditorName i:nil="true" />
<FilenameOrUrl i:nil="true" />
<ProjectAttachmentFolderId i:nil="true" />
<Size>0</Size>
<UploadDate>0001-01-01T00:00:00</UploadDate>
<Versions i:nil="true" />
</RemoteDocument>
{"AttachmentId":null,
"AttachmentTypeId":0,
"DocumentTypeId":null,
"DocumentStatusId":null,
"ProjectAttachmentFolderId":null,
"AttachedArtifacts":null,
"AuthorId":null,
"EditorId":null,
"AuthorGuid":null,
"EditorGuid":null,
"FilenameOrUrl":null,
"Description":null,
"UploadDate":"0001-01-01T00:00:00",
"EditedDate":"0001-01-01T00:00:00",
"Size":0,
"CurrentVersion":null,
"Versions":null,
"DocumentTypeName":null,
"DocumentStatusName":null,
"AttachmentTypeName":null,
"AuthorName":null,
"EditorName":null,
"ProjectId":0,
"ProjectGuid":null,
"ArtifactTypeId":0,
"ConcurrencyDate":"0001-01-01T00:00:00",
"CustomProperties":null,
"IsAttachments":false,
"Tags":null,
"Guid":null}