media/filescollection/{key}
Get the properties and contents of a files collection.
Files collections are used in certain scenarios where we need to provide a method one or more files for processing. In such a case, the API user uploads all the files needed to the collection and then passes the collection’s key to the processing method. Files collections are powerful in that they provide precise information on the allowed file types and extensions, maximum file size and many other details.
How do you create a new files collection “key”? You may wonder how you create a new files collection? The answer is with the method that requires a files collection as parameter. The documentation will describe how to obtain a “key”.
URL
(GET) /api/media/filescollection/{key}
PARAMETERS
The URL parameters are:
key | The unique files collection ID | string, Mandatory |
RESULTS
The result is a JSON object:
key | The files collection key. | string |
files | The list of files currently uploaded to the files collection. A newly created collection will be empty. The properties are JSON objects such as:
CODE
The name property is unique within a files collection. Use it to download a file, remove it from the collection or do other operations. See File object for a detailed description of properties. | for object[] |
mandatory | Boolean. Indicates if you must upload at least one file. Note: You usually contain the files collection key from the method that will then process the files and which sets the precise constraints regarding the files you can upload. | bool |
allowAnyFile | Boolean. If true, then you can upload any type of file with any extension. If false, check out the extensions property for allowed file extensions. | string |
maxFileSizeMB | The maximum allowed file size in MiB. | integer |
maxFiles | The maximum number of files you can import in one operation. | integer |
Advanced properties - Used in specific contexts only | ||
parserProfileId | Used in certain contexts only such as for uploading files to an order form. Here the parserProfileId indicates the document format profile to be used for processing files (the profile is a collection of file filters). The parserDomains enumerates the type of files that are supported. | integer? |
pageCountEnabled | If pageCountEnabled is true then you can set the page count for the uploaded files using the corresponding API method. This is typically used in contexts such as when submitting PDF files in an order form and the user is asked to type in the page count. Property pageCountExtensions is an optional list of file extensions for which the user is allowed to set page counts. | bool? |
EXAMPLES
Get the properties of a files collection:
GET /api/media/filescollection/5457027a-5c62-479a-aee1-f7dbbe3bfc28
An empty collection would return:
{
"key": "5457027a-5c62-479a-aee1-f7dbbe3bfc28",
"mandatory": true,
"allowAnyFile": false,
"maxFileSizeMB": 50,
"maxFiles": 50,
"parserProfileId": null,
"parserDomains": null,
"extensions": [
".xlf",
".xlif",
".xliff",
".xlsx",
".docx"
],
"pageCountEnabled": false,
"pageCountExtensions": null,
"files": []
}
Below, the same collection after uploading two XLIFF files:
{
"key": "5457027a-5c62-479a-aee1-f7dbbe3bfc28",
"mandatory": true,
"allowAnyFile": false,
"maxFileSizeMB": 50,
"maxFiles": 50,
"parserProfileId": null,
"parserDomains": null,
"extensions": [
".xlf",
".xlif",
".xliff",
".xlsx",
".docx"
],
"pageCountEnabled": false,
"pageCountExtensions": null,
"files": [
{
"name": "another.xliff",
"ext": ".xliff",
"translate": false,
"parserId": null,
"domain": null,
"parsers": null,
"pageCount": null,
"sizeKB": 154,
"comments": null
},
{
"name": "myfile.xliff",
"ext": ".xliff",
"translate": false,
"parserId": null,
"domain": null,
"parsers": null,
"pageCount": null,
"sizeKB": 31,
"comments": null
}
]
}