Method CreateFileFromTemplateBytes
CreateFileFromTemplateBytes(String, List<ListItemContract>, String, List<String>, String)
Creates a new file based and optional modules.
Allowed extensions: docx, docm, dotm, dotx, xlsx, xltx
Declaration
byte[] CreateFileFromTemplateBytes(string connectionId, List<ListItemContract> properties, string templateDocumentId, List<string> moduleDocumentIds, string dossierDocumentId)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionId | The connection id to identify your connection. See also ConnectionId |
System.Collections.Generic.List<ListItemContract> | properties | A list of properties which will be replaced in document |
System.String | templateDocumentId | The InfoShare document id for the main document. |
System.Collections.Generic.List<System.String> | moduleDocumentIds | Optional: a list of document ids which are added to the main document |
System.String | dossierDocumentId | Optional: Document id of the dossier cover file |
Returns
Type | Description |
---|---|
System.Byte[] | The newly generated document |
Examples
POST https://YourServerName/InfoShare/Json/DocumentProcessing/CreateFileFromTemplateBytes
Example for a creating a new document based on a template{
"connectionId": "3c82780c-d086-4564-ab20-915fc2182620",
"properties": [{
"Key": "InvoiceNumber",
"Value": "123456" },{
"Key": "CustomerName",
"Value": "My Company" }, ],
"templateDocumentId": "4ff080cc-a3da-e911-82a2-00155d7bfb0a"
}
Response:
{
"CreateFileFromTemplateBytesResult": [80, 75, 3, 4, 20, 0, 0, 0, 8, 0, ... 207, 33, 0, 0, 0, 0]
}
Exceptions
Type | Condition |
---|---|
ServiceException | The connection id {connectionId} isn't valid or has expired (10008) |
ServiceException | No document found for documentId {documentId} (10005) |
ServiceException | Unknown data type for property type (10035) |
ServiceException | Not enough rights ({accessOperationName}, {accessOperationId}) (10071) |
ServiceException | Document without file {documentId} (10004) |
ServiceException | From parameter to high (10009) |
ServiceException | Extension not allowed: {extension} (10109) |
ServiceException | Could not retrieve version {versionId} for document {documentId} (10130) |
ServiceException | Verification code is needed: Verification code not yet verified (10152) |
ServiceException | BlobStore {blobStoreId} is not available (10171) |
ServiceException | Could not get file stream: {errorMessage} (10172) |