PUT api/documents

Updates a document template by ID. Template name cannot be equal to an existing template name within the category, and the user must have the required privileges.

Request Information

URI Parameters

None.

Body Parameters

Document template to update.

DocumentListItemDTO
NameDescriptionTypeAdditional information
DocumentTemplateId

Unique ID representing the document template.

integer

None.

Category

Category that the template belongs to. Use application type, such as "CPP" or "Retail".

string

None.

Name

Name of the document template. Has to be unique within the category.

string

None.

Code

Unique code for the template within the category, when referring to it programatically.

string

None.

DownloadFileName

Filename used when downloading the generated document.

string

None.

Watermark

Text for the watermark used when the watermark flag is specified.

string

None.

TemplatePath

Name of the stored document template. Must be globally unique, and can be set only when creating the template.

string

None.

AccountingOfficeLevelId

Id of the accounting office level template, if it exists.

integer

None.

CompanyLevelId

Id of the company-level template, if it exists.

integer

None.

DepartmentLevelId

Id of the department-level template, if it exists.

integer

None.

DepartmentName

Name of the department.

string

None.

DepartmentId

Department Id.

integer

None.

Request Formats

application/json, text/json

Sample:
{
  "DocumentTemplateId": 1,
  "Category": "sample string 2",
  "Name": "sample string 3",
  "Code": "sample string 4",
  "DownloadFileName": "sample string 5",
  "Watermark": "sample string 6",
  "TemplatePath": "sample string 7",
  "AccountingOfficeLevelId": 1,
  "CompanyLevelId": 1,
  "DepartmentLevelId": 1,
  "DepartmentName": "sample string 8",
  "DepartmentId": 1
}

text/html

Sample:
{"DocumentTemplateId":1,"Category":"sample string 2","Name":"sample string 3","Code":"sample string 4","DownloadFileName":"sample string 5","Watermark":"sample string 6","TemplatePath":"sample string 7","AccountingOfficeLevelId":1,"CompanyLevelId":1,"DepartmentLevelId":1,"DepartmentName":"sample string 8","DepartmentId":1}

application/xml, text/xml

Sample:
<DocumentListItemDTO xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Common.WebAPI.DTOs">
  <AccountingOfficeLevelId>1</AccountingOfficeLevelId>
  <Category>sample string 2</Category>
  <Code>sample string 4</Code>
  <CompanyLevelId>1</CompanyLevelId>
  <DepartmentId>1</DepartmentId>
  <DepartmentLevelId>1</DepartmentLevelId>
  <DepartmentName>sample string 8</DepartmentName>
  <DocumentTemplateId>1</DocumentTemplateId>
  <DownloadFileName>sample string 5</DownloadFileName>
  <Name>sample string 3</Name>
  <TemplatePath>sample string 7</TemplatePath>
  <Watermark>sample string 6</Watermark>
</DocumentListItemDTO>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'DocumentListItemDTO'.

Response Information

Resource Description

None.