tvpl.api

<back to all web services

CreateCategoryRequest

Requires Authentication
Required role:super-admin
The following routes are available for this service:
POST/category/create
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports tvpl.api.ServiceModel
Imports tvpl.data.Models
Imports tvpl.data.Constant

Namespace Global

    Namespace tvpl.api.ServiceModel

        Public Partial Class CreateCategoryRequest
            Inherits CreateCategoryModel
        End Class

        Public Partial Class CreateCategoryResponse
            Implements IResponseRequest
            Public Overridable Property Id As Long
            Public Overridable Property Code As Integer
            Public Overridable Property Message As String
        End Class
    End Namespace

    Namespace tvpl.data.Constant

        Public Enum CategoryTypes
            Department
            PartyGroup
            DocGroup
            DocType
            IssuingAgency
            Status
            Subjects
            Workflow
        End Enum
    End Namespace

    Namespace tvpl.data.Models

        Public Partial Class CreateCategoryModel
            Public Sub New()
                ChildList = New List(Of Integer)
            End Sub

            Public Overridable Property Name As String
            Public Overridable Property Description As String
            Public Overridable Property Type As CategoryTypes
            Public Overridable Property IsParty As Boolean
            <Ignore>
            Public Overridable Property ChildList As List(Of Integer)
        End Class
    End Namespace
End Namespace

VB.NET CreateCategoryRequest DTOs

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

HTTP + JSV

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

POST /category/create HTTP/1.1 
Host: etc-api.vsmlab.vn 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	name: String,
	description: String,
	type: Department,
	isParty: False,
	childList: 
	[
		0
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	id: 0,
	code: 0,
	message: String
}