tvpl.api

<back to all web services

CreateOrUpdateTemplateRequest

Requires Authentication
Required role:super-admin
The following routes are available for this service:
POST/document-template
CreateOrUpdateTemplateRequest Parameters:
NameParameterData TypeRequiredDescription
Idbodyint?No
DocumentIdsbodyList<int>Yes
TitlebodystringNo
DescriptionbodystringNo
IsActivebodyboolNo
ElementsbodyList<DocumentElementDto>No
DocumentElementDto Parameters:
NameParameterData TypeRequiredDescription
ChildrenformList<DocumentElementDto>Yes
DocumentElement Parameters:
NameParameterData TypeRequiredDescription
IdformintNo
TemplateIdformintNo
ElementKeyformstringYes
TagformstringYes
ParentIdformint?No
TitleformstringYes
DescriptionformstringNo
DataTypeformstringYes
TemplateTypeformstringNo
OrderIndexformintNo
IsRequiredformbool?No
CreateDocumentTemplateResponse Parameters:
NameParameterData TypeRequiredDescription
InsertedIdformintNo
CodeformintNo
MessageformstringNo

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /document-template HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"id":0,"documentIds":[0],"title":"String","description":"String","isActive":false,"elements":[{"children":[{"children":[{"children":null,"id":0,"templateId":0,"elementKey":"String","tag":"String","parentId":0,"title":"String","description":"String","dataType":"String","templateType":"String","orderIndex":0,"isRequired":false}],"id":0,"templateId":0,"elementKey":"String","tag":"String","parentId":0,"title":"String","description":"String","dataType":"String","templateType":"String","orderIndex":0,"isRequired":false}],"id":0,"templateId":0,"elementKey":"String","tag":"String","parentId":0,"title":"String","description":"String","dataType":"String","templateType":"String","orderIndex":0,"isRequired":false}]}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"insertedId":0,"code":0,"message":"String"}