tvpl.api

<back to all web services

GetTemplateByIdRequest

Requires Authentication
The following routes are available for this service:
GET/document-template
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class GetTemplateByIdRequest
    {
        public Integer id = null;
        
        public Integer getId() { return id; }
        public GetTemplateByIdRequest setId(Integer value) { this.id = value; return this; }
    }

    public static class DocumentTemplateResponse
    {
        public DocumentTemplateDto template = null;
        public Integer insertedId = null;
        public Integer code = null;
        public String message = null;
        
        public DocumentTemplateDto getTemplate() { return template; }
        public DocumentTemplateResponse setTemplate(DocumentTemplateDto value) { this.template = value; return this; }
        public Integer getInsertedId() { return insertedId; }
        public DocumentTemplateResponse setInsertedId(Integer value) { this.insertedId = value; return this; }
        public Integer getCode() { return code; }
        public DocumentTemplateResponse setCode(Integer value) { this.code = value; return this; }
        public String getMessage() { return message; }
        public DocumentTemplateResponse setMessage(String value) { this.message = value; return this; }
    }

    public static class DocumentTemplateDto extends DocumentTemplate
    {
        public ArrayList<DocumentElementDto> elements = null;
        
        public ArrayList<DocumentElementDto> getElements() { return elements; }
        public DocumentTemplateDto setElements(ArrayList<DocumentElementDto> value) { this.elements = value; return this; }
    }

    public static class DocumentTemplate
    {
        public Integer id = null;
        @Required()
        public String title = null;

        public String description = null;
        public Boolean isActive = null;
        public String fileKey = null;
        public String fileUrl = null;
        public String fileName = null;
        public Long fileSize = null;
        
        public Integer getId() { return id; }
        public DocumentTemplate setId(Integer value) { this.id = value; return this; }
        public String getTitle() { return title; }
        public DocumentTemplate setTitle(String value) { this.title = value; return this; }
        public String getDescription() { return description; }
        public DocumentTemplate setDescription(String value) { this.description = value; return this; }
        public Boolean getIsActive() { return isActive; }
        public DocumentTemplate setIsActive(Boolean value) { this.isActive = value; return this; }
        public String getFileKey() { return fileKey; }
        public DocumentTemplate setFileKey(String value) { this.fileKey = value; return this; }
        public String getFileUrl() { return fileUrl; }
        public DocumentTemplate setFileUrl(String value) { this.fileUrl = value; return this; }
        public String getFileName() { return fileName; }
        public DocumentTemplate setFileName(String value) { this.fileName = value; return this; }
        public Long getFileSize() { return fileSize; }
        public DocumentTemplate setFileSize(Long value) { this.fileSize = value; return this; }
    }

    public static class DocumentElementDto extends DocumentElement
    {
        public ArrayList<DocumentElementDto> children = null;
        
        public ArrayList<DocumentElementDto> getChildren() { return children; }
        public DocumentElementDto setChildren(ArrayList<DocumentElementDto> value) { this.children = value; return this; }
    }

    public static class DocumentElement
    {
        public Integer id = null;
        public Integer templateId = null;
        @Required()
        public String elementKey = null;

        @Required()
        public String tag = null;

        public Integer parentId = null;
        @Required()
        public String title = null;

        public String description = null;
        @Required()
        public String dataType = null;

        public String templateType = null;
        public Integer orderIndex = null;
        public Boolean isRequired = null;
        
        public Integer getId() { return id; }
        public DocumentElement setId(Integer value) { this.id = value; return this; }
        public Integer getTemplateId() { return templateId; }
        public DocumentElement setTemplateId(Integer value) { this.templateId = value; return this; }
        public String getElementKey() { return elementKey; }
        public DocumentElement setElementKey(String value) { this.elementKey = value; return this; }
        public String getTag() { return tag; }
        public DocumentElement setTag(String value) { this.tag = value; return this; }
        public Integer getParentId() { return parentId; }
        public DocumentElement setParentId(Integer value) { this.parentId = value; return this; }
        public String getTitle() { return title; }
        public DocumentElement setTitle(String value) { this.title = value; return this; }
        public String getDescription() { return description; }
        public DocumentElement setDescription(String value) { this.description = value; return this; }
        public String getDataType() { return dataType; }
        public DocumentElement setDataType(String value) { this.dataType = value; return this; }
        public String getTemplateType() { return templateType; }
        public DocumentElement setTemplateType(String value) { this.templateType = value; return this; }
        public Integer getOrderIndex() { return orderIndex; }
        public DocumentElement setOrderIndex(Integer value) { this.orderIndex = value; return this; }
        public Boolean getIsRequired() { return isRequired; }
        public DocumentElement setIsRequired(Boolean value) { this.isRequired = value; return this; }
    }

}

Java GetTemplateByIdRequest DTOs

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.

GET /document-template HTTP/1.1 
Host: qlcn-api.vsmlab.vn 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"template":{"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}],"id":0,"title":"String","description":"String","isActive":false,"fileKey":"String","fileUrl":"String","fileName":"String","fileSize":0},"insertedId":0,"code":0,"message":"String"}