fileId
which can be used to pass that file as input to a process or viewing session or to download the raw bytes of the file.API Reference > PrizmDoc Server RESTful API > Work Files |
fileId
which can be used to pass that file as input to a process or viewing session or to download the raw bytes of the file.Work files should not be used for archival storage. All work files are temporary and, by default, will be deleted 24 hours after creation.
POST /PCCIS/V1/WorkFile when body is file bytes | Creates a work file resource from file bytes (used to upload input files). |
POST /PCCIS/V1/WorkFile when body is JSON | Creates a "package" work file from a set of existing work files. Used to prepare a set of dependent files for viewing or processing (e.g. CAD with XREF). |
GET /PCCIS/V1/WorkFile/{fileId} | Gets the file bytes associated with a work file resource (used to download output files). |
GET /PCCIS/V1/WorkFile/{fileId}/Info | Gets metadata information about a work file resource. |
Creates a work file resource from file bytes (used to upload input files).
Example:
POST /PCCIS/V1/WorkFile
Content-Type: application/octet-stream
<<file bytes>>
HTTP/1.1 200 OK
Content-Type: application/json
{
"fileId": "Xe6zv3dH0kVSzLuaNhd32A",
"fileExtension": "pdf",
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Description |
---|---|
Content-Type |
We recommend you use the value If you do not provide a value, |
Accusoft-Affinity-Token |
Used to ensure that this work file will be assigned to the same machine in the cluster as another existing resource (work file, process, or viewing session). If provided, the value must be the If not provided, an |
POST /PCCIS/V1/WorkFile{?FileExtension,MinSecondsAvailable}
Name | Type | Description | Example |
---|---|---|---|
FileExtension |
string |
File extension of the file being uploaded without any leading period. Only required when the file type cannot be automatically detected (e.g. Note that, if we are able to detect the file type automatically, the detected type will always be used and this value will be ignored. |
pdf |
MinSecondsAvailable |
integer |
The minimum number of seconds this work file must remain available. The actual lifetime may be longer. |
300 |
The bytes of the file being uploaded.
JSON with metadata about the newly created work file.
Name | Value |
---|---|
Content-Type |
application/json |
{
"fileId": "Xe6zv3dH0kVSzLuaNhd32A",
"fileExtension": "pdf",
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Type | Description |
---|---|---|
fileId |
string | The unique id of the new work file resource, often used later as input to a viewing session or process. |
fileExtension |
string | The file extension assigned to this resource which indicates what type of file we understand it to be. |
affinityToken |
string |
A value used to identify which machine in the cluster this work file resides on. Only present when there is more than one machine in the cluster. A work file is only accessible to another resource if that resource resides on the same machine in the cluster. You can ensure that other resources you create (work files, viewing sessions, and processes) are assigned to the same machine by passing this value in an |
Status Code | JSON errorCode | Description |
---|---|---|
400 | - |
There was a problem with an input parameter:
|
405 | - | An HTTP method other than POST was used. |
580 | UnrecognizedFileFormat |
The file type of the uploaded bytes could not be automatically detected. You will need to manually specify a FileExtension . If you are getting this error for every file type which you upload, it is possible that automatic format detection needs to be enabled on your server. |
Creates a "package" work file from a set of existing work files, defining one file in the set as the primary file for viewing and content conversion.
This special type of work file is particularly useful for CAD drawings which are made up of multiple files (such as dwg files which use other files via XREF).
Example:
POST /PCCIS/V1/WorkFile
Content-Type: application/json
Accusoft-Affinity-Token: ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=
{
"primaryPath": "master.dwg",
"items": [
{ "fileId": "CVBuD7DbQYNoJDqByGierQ", "path": "master.dwg" },
{ "fileId": "5qTYa3gzN9gYUb5SzqUhqg", "path": "parts/a.dwg" },
{ "fileId": "o1bLJwFGxf9QGuTkyrOqig", "path": "parts/b.dwg" }
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"fileId": "nkG9fiAmj27X3MhqGdbsXA",
"primaryPath": "master.dwg",
"items": [
{ "fileId": "CVBuD7DbQYNoJDqByGierQ", "path": "master.dwg" },
{ "fileId": "5qTYa3gzN9gYUb5SzqUhqg", "path": "parts/a.dwg" },
{ "fileId": "o1bLJwFGxf9QGuTkyrOqig", "path": "parts/b.dwg" }
],
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Description |
---|---|
Content-Type |
You must use the value If you forget to specify a |
Accusoft-Affinity-Token |
Whenever there is more than one machine in the cluster, you will need to ensure that all of the work files in the set reside on to the same machine. To do this, upload the first file in the set, get the |
POST /PCCIS/V1/WorkFile{?MinSecondsAvailable}
Name | Type | Description | Example |
---|---|---|---|
MinSecondsAvailable |
integer |
The minimum number of seconds this work file must remain available. The actual lifetime may be longer. |
300 |
A JSON object which specifies:
For example:
{
"primaryPath": "master.dwg",
"items": [
{ "fileId": "CVBuD7DbQYNoJDqByGierQ", "path": "master.dwg" },
{ "fileId": "5qTYa3gzN9gYUb5SzqUhqg", "path": "parts/a.dwg" },
{ "fileId": "o1bLJwFGxf9QGuTkyrOqig", "path": "parts/b.dwg" }
]
}
Name | Type | Description |
---|---|---|
primaryPath |
string | Required. The primary entry point for viewing or conversion. This value must match the path value of one of the objects in the items array. |
items |
array | Required. The work files which are to be included in the set and what their local paths would be. |
Name | Type | Description |
---|---|---|
fileId |
string | Required. The fileId of a work file to be included in the set. |
path |
string | Required. A path value for this file in the set. Typically this is just the relative path of this file in relation to the primary file. Each item in the set must have a unique path value. |
JSON with metadata about the new work file resource, the most important part being a new fileId
which you can use to represent the entire set of files.
Name | Value |
---|---|
Content-Type |
application/json |
{
"fileId": "nkG9fiAmj27X3MhqGdbsXA",
"primaryPath": "master.dwg",
"items": [
{ "fileId": "CVBuD7DbQYNoJDqByGierQ", "path": "master.dwg" },
{ "fileId": "5qTYa3gzN9gYUb5SzqUhqg", "path": "parts/a.dwg" },
{ "fileId": "o1bLJwFGxf9QGuTkyrOqig", "path": "parts/b.dwg" }
],
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Type | Description |
---|---|---|
fileId |
string | The unique id of this new "package" work file, intended to be used as input to a viewing session or process which needs to consume the entire package as a single document. |
primaryPath |
string | The primary entry point which will be used for viewing or conversion. |
items |
array | The work files which are included in the set and their assigned paths. |
affinityToken |
string |
A value used to identify which machine in the cluster this work file resides on. Only present when there is more than one machine in the cluster. A work file is only accessible to another resource if that resource resides on the same machine in the cluster. You can ensure that other resources you create (work files, viewing sessions, and processes) are assigned to the same machine by passing this value in an |
Status Code | JSON errorCode | Description |
---|---|---|
480 | "MissingInput" |
A required input was not provided. See the |
480 | "InvalidInput" |
One of the input values was invalid. Possible causes:
See the |
480 | "ValueMustBeUnique" |
One or more of the path values in the items array was non-unique. |
580 | UnrecognizedFileFormat |
This will occur if you forget to specify a If you are trying to create a work file from a set of existing work files (as described in this section), make sure you set the request |
Gets the file bytes associated with a work file resource (used to download output files).
Example:
GET /PCCIS/V1/WorkFile/Xe6zv3dH0kVSzLuaNhd32A
Accusoft-Affinity-Token: ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=
HTTP/1.1 200 OK
Content-Type: application/pdf
<<file bytes>>
Name | Description |
---|---|
Accusoft-Affinity-Token |
If there is more than one machine in the cluster (an |
GET /PCCIS/V1/WorkFile/{fileId}{?ContentDispositionFilename}
Name | Type | Description | Example |
---|---|---|---|
fileId |
string | Required. The fileId of the work file whose file bytes you want to download. |
Xe6zv3dH0kVSzLuaNhd32A |
ContentDispositionFilename |
string |
The filename which will be used in the response Content-Disposition header, but without any file extension. The file extension will be supplied for you automatically. For example, if you specified a
If you do not specify a value, a filename will be used which is based upon the
|
FinancialReport |
The raw bytes of the file.
Name | Description | Example |
---|---|---|
Content-Type |
The MIME type of the file being downloaded. | application/pdf |
Content-Disposition |
Set to See the |
attachment; filename=file-Xe6zv3dH0kVSzLuaNhd32A.pdf |
The raw bytes of the file.
Status Code | JSON errorCode | Description |
---|---|---|
400 | "InvalidInput" |
One of the input values was invalid. Possible causes:
See the |
480 | "DataNotAvailable" |
No file bytes exist for download. This can occur if you attempt to download the file bytes for a "package" work file which merely groups a set of related work files under a single |
404 | - | No work file existed for the given fileId . |
405 | - | An HTTP method other than GET was used. |
Gets metadata information about a work file resource, the same information returned in the original POST request which created the work file.
Example:
GET /PCCIS/V1/WorkFile/Xe6zv3dH0kVSzLuaNhd32A/Info
Accusoft-Affinity-Token: ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM=
HTTP/1.1 200 OK
Content-Type: application/json
{
"fileId": "Xe6zv3dH0kVSzLuaNhd32A",
"fileExtension": "pdf",
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Description |
---|---|
Accusoft-Affinity-Token |
If there is more than one machine in the cluster (an |
GET /PCCIS/V1/WorkFile/{fileId}/Info
Name | Type | Description | Example |
---|---|---|---|
fileId |
string | Required. The fileId of the work file you need information about. |
Xe6zv3dH0kVSzLuaNhd32A |
JSON with information about the work file.
Name | Value |
---|---|
Content-Type |
application/json |
{
"fileId": "Xe6zv3dH0kVSzLuaNhd32A",
"fileExtension": "pdf",
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Type | Description |
---|---|---|
fileId |
string | The unique id of this resource. |
fileExtension |
string |
File extension assigned to this resource, indicating what type of file we understand it to be. |
affinityToken |
string |
A value used to identify which machine in the cluster this work file resides on. Only present when there is more than one machine in the cluster. |
{
"fileId": "nkG9fiAmj27X3MhqGdbsXA",
"primaryPath": "master.dwg",
"items": [
{ "fileId": "CVBuD7DbQYNoJDqByGierQ", "path": "master.dwg" },
{ "fileId": "5qTYa3gzN9gYUb5SzqUhqg", "path": "parts/a.dwg" },
{ "fileId": "o1bLJwFGxf9QGuTkyrOqig", "path": "parts/b.dwg" }
],
"affinityToken": "ejN9/kXEYOuken4Pb9ic9hqJK45XIad9LQNgCgQ+BkM="
}
Name | Type | Description |
---|---|---|
fileId |
string | The unique id of this resource. |
primaryPath |
string | The primary entry point which will be used for viewing or conversion. |
items |
array | The work files which are included in the set and their assigned paths. |
affinityToken |
string |
A value used to identify which machine in the cluster this work file resides on. Only present when there is more than one machine in the cluster. |
Status Code | Description |
---|---|
404 | No work file existed for the given fileId . |
405 | An HTTP method other than GET was used. |