Field Squared API Services

<back to all web services

IntegrationRule

Represents a set of rules what the system reads to take a particular set of actions. These dtos allow transfer of that data from the client to the server and vice versa.

The following routes are available for this service:
GET,PUT,DELETE/{WorkspaceId}/IntegrationRule/{Id}

export enum PossibleComparisons
{
    LTE = 'LTE',
    LT = 'LT',
    GT = 'GT',
    GTE = 'GTE',
    EQ = 'EQ',
    NE = 'NE',
    NULL = 'NULL',
    NOTNULL = 'NOTNULL',
    CHG = 'CHG',
    STARTS = 'STARTS',
    LIKE = 'LIKE',
}

export class Condition
{
    public ValueComparedTo: string;
    public ValueToCompare: string;
    public ComparisonOperator: PossibleComparisons;

    public constructor(init?: Partial<Condition>) { (Object as any).assign(this, init); }
}

export class ConditionGroup
{
    public Condition: Condition;
    public Precedence: number;
    public GroupIdentifier: number;
    public BooleanOperator: string;

    public constructor(init?: Partial<ConditionGroup>) { (Object as any).assign(this, init); }
}

export class ConditionGroupItem
{
    public ConditionGroups: ConditionGroup[];
    public Precedence: number;
    public GroupIdentifier: number;
    public BooleanOperator: string;

    public constructor(init?: Partial<ConditionGroupItem>) { (Object as any).assign(this, init); }
}

export class Action
{
    public Id: string;
    public CallType: string;
    public ActionToTake: string;
    public Destination: string;
    public ExternalId: string;
    public ExternalParentId: string;
    public DeleteTypeIfNotExists: string;
    public DataTree: { [index: string]: Object; };
    public Data: string;
    public DataTypes: { [index: string]: Object; };

    public constructor(init?: Partial<Action>) { (Object as any).assign(this, init); }
}

export class RuleModuleDefinition
{
    public IsOutputModule: boolean;
    public Name: string;
    public Prerequisites: string[];
    public Parameters: { [index: string]: Object; };
    public Type: string;
    public OutputAction: Action;

    public constructor(init?: Partial<RuleModuleDefinition>) { (Object as any).assign(this, init); }
}

/** @description Represents a set of rules what the system reads to take a particular set of actions. These dtos allow transfer of that data from the client to the server and vice versa. */
export class IntegrationRule
{
    public WorkspaceId: string;
    public Name: string;
    public Data: { [index: string]: Object; };
    public ObjectType: string;
    public Id: string;
    public ConditionGroupItems: ConditionGroupItem[];
    public ActionsToTake: Action[];
    public LastUpdated: string;
    public ModulePipeline: RuleModuleDefinition[];
    public Enabled: boolean;
    public WorkdayRestricted: boolean;
    public Teams: string[];
    public AllowProgrammaticTrigger: boolean;

    public constructor(init?: Partial<IntegrationRule>) { (Object as any).assign(this, init); }
}

TypeScript IntegrationRule 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.

PUT /{WorkspaceId}/IntegrationRule/{Id} HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	WorkspaceId: String,
	Name: String,
	Data: 
	{
		value: String
	},
	ObjectType: String,
	Id: String,
	ConditionGroupItems: 
	[
		{
			ConditionGroups: 
			[
				{
					Condition: 
					{
						ValueComparedTo: String,
						ValueToCompare: String,
						ComparisonOperator: LTE
					},
					Precedence: 0,
					GroupIdentifier: 0,
					BooleanOperator: String
				}
			],
			Precedence: 0,
			GroupIdentifier: 0,
			BooleanOperator: String
		}
	],
	ActionsToTake: 
	[
		{
			Id: String,
			CallType: String,
			ActionToTake: String,
			Destination: String,
			ExternalId: String,
			ExternalParentId: String,
			DeleteTypeIfNotExists: String,
			DataTree: 
			{
				String: {}
			},
			Data: String,
			DataTypes: 
			{
				String: {}
			}
		}
	],
	LastUpdated: 0001-01-01,
	ModulePipeline: 
	[
		{
			IsOutputModule: False,
			Name: String,
			Prerequisites: 
			[
				String
			],
			Parameters: 
			{
				String: {}
			},
			Type: String,
			OutputAction: 
			{
				Id: String,
				CallType: String,
				ActionToTake: String,
				Destination: String,
				ExternalId: String,
				ExternalParentId: String,
				DeleteTypeIfNotExists: String,
				DataTree: 
				{
					String: {}
				},
				Data: String,
				DataTypes: 
				{
					String: {}
				}
			}
		}
	],
	Enabled: False,
	WorkdayRestricted: False,
	Teams: 
	[
		String
	],
	AllowProgrammaticTrigger: False
}