Trendsic Platform Service

<back to all web services

MaterialRequest

Requires Authentication
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/Material/{MaterialID}
GET,POST,PUT,DELETE,OPTIONS/v1/Material

export class Project
{
    public ProjectID: number;
    public ProjectUID: string;
    public ProjectName: string;
    public ImageURL: string;
    public ImageKey: string;
    public ClientName: string;
    public ClientPhone: string;
    public ClientEmail: string;
    public ProjectManagerID: number;
    public ProjectManagerName: string;
    public StartDate?: string;
    public EndDate?: string;
    public ActualStartDate?: string;
    public ActualEndDate?: string;
    public JobCount: number;
    public CrewMemberCount: number;
    public EquipmentCount: number;
    public MaterialCount: number;
    public ProjectStatusID: number;
    public ProjectStatusDescription: string;
    public Budget: number;
    public CostToDate: number;
    public ProjectLocation: string;
    public ProjectType: string;
    public ProjectSponsor: string;
    public CreatedBy: string;
    public CreatedAt?: string;
    public UpdatedAt?: string;
    public ProjectDescription: string;
    public Scope: string;
    public StatusId: number;

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

export class Material
{
    public MaterialID: number;
    public MaterialName: string;
    public MaterialTypeID: number;
    public MaterialStatusID: number;
    public Quantity: number;
    public Supplier: string;
    public OrderDate: string;
    public DeliveryDate: string;
    public OnSiteDate: string;
    public MaterialLocation: string;
    public Manufacturer: string;
    public SerialNumber: string;
    public BarCode: string;
    public TrackingInfo: string;
    public MaterialDescription: string;
    public Notes: string;
    public ImageURL: string;
    public DetailsURL: string;
    public CreatedByUID: string;
    public Active: boolean;
    public RecordCreatedDate: string;
    public StatusId: number;
    public MaterialTypeName: string;
    public Cost: number;
    public Projects: Project[] = [];

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

export class MaterialResponse
{
    public ResponseStatus: ResponseStatus;
    public Material: Material[] = [];

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

export class MaterialRequest
{
    public MaterialID: number;
    public Material: Material[] = [];

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

TypeScript MaterialRequest 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 /v1/Material/{MaterialID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	MaterialID: 0,
	Material: 
	[
		{
			MaterialID: 0,
			MaterialName: String,
			MaterialTypeID: 0,
			MaterialStatusID: 0,
			Quantity: 0,
			Supplier: String,
			OrderDate: 0001-01-01,
			DeliveryDate: 0001-01-01,
			OnSiteDate: 0001-01-01,
			MaterialLocation: String,
			Manufacturer: String,
			SerialNumber: String,
			BarCode: String,
			TrackingInfo: String,
			MaterialDescription: String,
			Notes: String,
			ImageURL: String,
			DetailsURL: String,
			CreatedByUID: 00000000000000000000000000000000,
			Active: False,
			RecordCreatedDate: 0001-01-01,
			StatusId: 0,
			MaterialTypeName: String,
			Cost: 0,
			Projects: 
			[
				{
					ProjectID: 0,
					ProjectUID: 00000000000000000000000000000000,
					ProjectName: String,
					ImageURL: String,
					ImageKey: String,
					ClientName: String,
					ClientPhone: String,
					ClientEmail: String,
					ProjectManagerID: 0,
					ProjectManagerName: String,
					StartDate: 0001-01-01,
					EndDate: 0001-01-01,
					ActualStartDate: 0001-01-01,
					ActualEndDate: 0001-01-01,
					JobCount: 0,
					CrewMemberCount: 0,
					EquipmentCount: 0,
					MaterialCount: 0,
					ProjectStatusID: 0,
					ProjectStatusDescription: String,
					Budget: 0,
					CostToDate: 0,
					ProjectLocation: String,
					ProjectType: String,
					ProjectSponsor: String,
					CreatedBy: String,
					CreatedAt: 0001-01-01,
					UpdatedAt: 0001-01-01,
					ProjectDescription: String,
					Scope: String,
					StatusId: 0
				}
			]
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Material: 
	[
		{
			MaterialID: 0,
			MaterialName: String,
			MaterialTypeID: 0,
			MaterialStatusID: 0,
			Quantity: 0,
			Supplier: String,
			OrderDate: 0001-01-01,
			DeliveryDate: 0001-01-01,
			OnSiteDate: 0001-01-01,
			MaterialLocation: String,
			Manufacturer: String,
			SerialNumber: String,
			BarCode: String,
			TrackingInfo: String,
			MaterialDescription: String,
			Notes: String,
			ImageURL: String,
			DetailsURL: String,
			CreatedByUID: 00000000000000000000000000000000,
			Active: False,
			RecordCreatedDate: 0001-01-01,
			StatusId: 0,
			MaterialTypeName: String,
			Cost: 0,
			Projects: 
			[
				{
					ProjectID: 0,
					ProjectUID: 00000000000000000000000000000000,
					ProjectName: String,
					ImageURL: String,
					ImageKey: String,
					ClientName: String,
					ClientPhone: String,
					ClientEmail: String,
					ProjectManagerID: 0,
					ProjectManagerName: String,
					StartDate: 0001-01-01,
					EndDate: 0001-01-01,
					ActualStartDate: 0001-01-01,
					ActualEndDate: 0001-01-01,
					JobCount: 0,
					CrewMemberCount: 0,
					EquipmentCount: 0,
					MaterialCount: 0,
					ProjectStatusID: 0,
					ProjectStatusDescription: String,
					Budget: 0,
					CostToDate: 0,
					ProjectLocation: String,
					ProjectType: String,
					ProjectSponsor: String,
					CreatedBy: String,
					CreatedAt: 0001-01-01,
					UpdatedAt: 0001-01-01,
					ProjectDescription: String,
					Scope: String,
					StatusId: 0
				}
			]
		}
	]
}