Field Squared API Services

<back to all web services

InventoryItemTemplate

The following routes are available for this service:
GET,PUT,POST,DELETE/{Workspace}/InventoryItemTemplate
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Field2Office.API.Model.Inventory;
using Field2Office.API.Model.Workspaces;
using Field2Office.DomainObjects;

namespace Field2Office.API.Model.Inventory
{
    public partial class InventoryItemTemplate
    {
        public InventoryItemTemplate()
        {
            CustomFields = new List<CustomField>{};
        }

        public virtual string ObjectId { get; set; }
        public virtual string Workspace { get; set; }
        public virtual string Name { get; set; }
        public virtual List<CustomField> CustomFields { get; set; }
    }

}

namespace Field2Office.API.Model.Workspaces
{
    public partial class CustomField
    {
        public CustomField()
        {
            Hidden = new List<string>{};
            ReadOnly = new List<string>{};
            ControlArgs = new Dictionary<string, Object>{};
        }

        public virtual string Key { get; set; }
        public virtual string Label { get; set; }
        public virtual bool IsActive { get; set; }
        public virtual bool IsReadOnly { get; set; }
        public virtual bool IsHidden { get; set; }
        public virtual bool IsMandatory { get; set; }
        public virtual bool DisplayOnMap { get; set; }
        public virtual CustomFieldDataType CustomFieldDataType { get; set; }
        public virtual string Values { get; set; }
        public virtual string Prompt { get; set; }
        public virtual string Default { get; set; }
        public virtual bool DefaultAutoUpdate { get; set; }
        public virtual string RequiredIf { get; set; }
        public virtual List<string> Hidden { get; set; }
        public virtual List<string> ReadOnly { get; set; }
        public virtual Dictionary<string, Object> ControlArgs { get; set; }
        public virtual string IndexSlot { get; set; }
        public virtual string Index { get; set; }
    }

}

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,
    }

}

C# InventoryItemTemplate 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 /{Workspace}/InventoryItemTemplate HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ObjectId: String,
	Workspace: String,
	Name: String,
	CustomFields: 
	[
		{
			Key: String,
			Label: String,
			IsActive: False,
			IsReadOnly: False,
			IsHidden: False,
			IsMandatory: False,
			DisplayOnMap: False,
			CustomFieldDataType: Text,
			Values: String,
			Prompt: String,
			Default: String,
			DefaultAutoUpdate: False,
			RequiredIf: String,
			Hidden: 
			[
				String
			],
			ReadOnly: 
			[
				String
			],
			ControlArgs: 
			{
				String: {}
			},
			IndexSlot: String,
			Index: String
		}
	]
}