| GET,PUT,POST,DELETE | /{Workspace}/LaborItemTemplate | 
|---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Field2Office.API.Model.PricingEngine
Imports Field2Office.API.Model.Workspaces
Imports Field2Office.DomainObjects
Namespace Global
    Namespace Field2Office.API.Model.PricingEngine
        Public Partial Class LaborItemTemplate
            Public Sub New()
                CustomFields = New List(Of CustomField)
            End Sub
            Public Overridable Property ObjectId As String
            Public Overridable Property Workspace As String
            Public Overridable Property Name As String
            Public Overridable Property CustomFields As List(Of CustomField)
        End Class
    End Namespace
    Namespace Field2Office.API.Model.Workspaces
        Public Partial Class CustomField
            Public Sub New()
                Hidden = New List(Of String)
                ReadOnly = New List(Of String)
                ControlArgs = New Dictionary(Of String, Object)
            End Sub
            Public Overridable Property Key As String
            Public Overridable Property Label As String
            Public Overridable Property IsActive As Boolean
            Public Overridable Property IsReadOnly As Boolean
            Public Overridable Property IsHidden As Boolean
            Public Overridable Property IsMandatory As Boolean
            Public Overridable Property DisplayOnMap As Boolean
            Public Overridable Property CustomFieldDataType As CustomFieldDataType
            Public Overridable Property Values As String
            Public Overridable Property Prompt As String
            Public Overridable Property [Default] As String
            Public Overridable Property DefaultAutoUpdate As Boolean
            Public Overridable Property RequiredIf As String
            Public Overridable Property Hidden As List(Of String)
            Public Overridable Property ReadOnly As List(Of String)
            Public Overridable Property ControlArgs As Dictionary(Of String, Object)
            Public Overridable Property IndexSlot As String
            Public Overridable Property Index As String
        End Class
    End Namespace
    Namespace Field2Office.DomainObjects
        Public Enum CustomFieldDataType
            Text
            Number
            [Decimal]
            Money
            PhoneNumber
            Ssn
            List
            [Date]
            File
            Barcode
            GPS
            Photo
            Spacer
            Separator
            AutoNumber
            TextArea
            Contact
            User
            Asset
            Checkbox
            CoreAssetList
            CoreTaskList
            CoreParentTask
            CoreContactList
            ComboBox
            DateTime
            Time
            Location
            CoreLocation
            Label
            EventLog
            Address
            Catalog
            CoreTeamList
            Segment
            CoreTimeSeries
            TimeSeries
            Command
            AutoNumberNumeric
            CatalogList
            CatalogComboBox
            DateRange
            DocumentGrid
            ReportLink
            Hyperlink
            PercentComplete
            Chart
            Range
            ExternalId
            AssetCatalog
            Inventory
            CoreTaskLaborItemTypes
            CoreTaskLaborItems
            ObjectList
            CoreTimeZone
        End Enum
    End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /{Workspace}/LaborItemTemplate HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<LaborItemTemplate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.PricingEngine">
  <CustomFields xmlns:d2p1="http://schemas.datacontract.org/2004/07/Field2Office.API.Model.Workspaces">
    <d2p1:CustomField>
      <d2p1:ControlArgs xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringanyType>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value />
        </d4p1:KeyValueOfstringanyType>
      </d2p1:ControlArgs>
      <d2p1:CustomFieldDataType>Text</d2p1:CustomFieldDataType>
      <d2p1:Default>String</d2p1:Default>
      <d2p1:DefaultAutoUpdate>false</d2p1:DefaultAutoUpdate>
      <d2p1:DisplayOnMap>false</d2p1:DisplayOnMap>
      <d2p1:Hidden xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:Hidden>
      <d2p1:Index>String</d2p1:Index>
      <d2p1:IndexSlot>String</d2p1:IndexSlot>
      <d2p1:IsActive>false</d2p1:IsActive>
      <d2p1:IsHidden>false</d2p1:IsHidden>
      <d2p1:IsMandatory>false</d2p1:IsMandatory>
      <d2p1:IsReadOnly>false</d2p1:IsReadOnly>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Label>String</d2p1:Label>
      <d2p1:Prompt>String</d2p1:Prompt>
      <d2p1:ReadOnly xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:string>String</d4p1:string>
      </d2p1:ReadOnly>
      <d2p1:RequiredIf>String</d2p1:RequiredIf>
      <d2p1:Values>String</d2p1:Values>
    </d2p1:CustomField>
  </CustomFields>
  <Name>String</Name>
  <ObjectId>String</ObjectId>
  <Workspace>String</Workspace>
</LaborItemTemplate>