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
namespace tvpl.api.ServiceModel

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type CreateDocumentTemplateResponse() = 
        member val InsertedId:Int32 = new Int32() with get,set
        member val Code:Int32 = new Int32() with get,set
        member val Message:String = null with get,set

    [<AllowNullLiteral>]
    type DocumentElement() = 
        member val Id:Int32 = new Int32() with get,set
        member val TemplateId:Int32 = new Int32() with get,set
        [<Required>]
        member val ElementKey:String = null with get,set

        [<Required>]
        member val Tag:String = null with get,set

        member val ParentId:Nullable<Int32> = new Nullable<Int32>() with get,set
        [<Required>]
        member val Title:String = null with get,set

        member val Description:String = null with get,set
        [<Required>]
        member val DataType:String = null with get,set

        member val TemplateType:String = null with get,set
        member val OrderIndex:Int32 = new Int32() with get,set
        member val IsRequired:Nullable<Boolean> = new Nullable<Boolean>() with get,set

    [<AllowNullLiteral>]
    type DocumentElementDto() = 
        inherit DocumentElement()
        member val Children:ResizeArray<DocumentElementDto> = new ResizeArray<DocumentElementDto>() with get,set

    [<AllowNullLiteral>]
    type CreateOrUpdateTemplateRequest() = 
        member val Id:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val DocumentIds:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val Title:String = null with get,set
        member val Description:String = null with get,set
        member val IsActive:Boolean = new Boolean() with get,set
        member val Elements:ResizeArray<DocumentElementDto> = new ResizeArray<DocumentElementDto>() with get,set

F# CreateOrUpdateTemplateRequest DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<CreateOrUpdateTemplateRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <Description>String</Description>
  <DocumentIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </DocumentIds>
  <Elements>
    <DocumentElementDto>
      <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
      <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
      <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
      <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
      <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
      <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
      <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
      <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
      <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
      <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
      <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
      <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
      <Children>
        <DocumentElementDto>
          <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
          <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
          <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
          <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
          <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
          <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
          <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
          <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
          <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
          <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
          <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
          <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
          <Children>
            <DocumentElementDto>
              <CreatedAt xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0001-01-01T00:00:00</CreatedAt>
              <DataType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</DataType>
              <Description xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Description>
              <ElementKey xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</ElementKey>
              <Id xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</Id>
              <IsRequired xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">false</IsRequired>
              <OrderIndex xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</OrderIndex>
              <ParentId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</ParentId>
              <Tag xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Tag>
              <TemplateId xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">0</TemplateId>
              <TemplateType xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</TemplateType>
              <Title xmlns="http://schemas.datacontract.org/2004/07/tvpl.data.Models">String</Title>
              <Children i:nil="true" />
            </DocumentElementDto>
          </Children>
        </DocumentElementDto>
      </Children>
    </DocumentElementDto>
  </Elements>
  <Id>0</Id>
  <IsActive>false</IsActive>
  <Title>String</Title>
</CreateOrUpdateTemplateRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CreateDocumentTemplateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/tvpl.api.ServiceModel">
  <Code>0</Code>
  <InsertedId>0</InsertedId>
  <Message>String</Message>
</CreateDocumentTemplateResponse>