Trendsic Platform Service

<back to all web services

MaterialUsageRequest

Requires Authentication
The following routes are available for this service:
GET,OPTIONS/v1/Material/{MaterialID}/usage
"use strict";
export class MaterialUsageEntry {
    /** @param {{Scope?:string,ProjectID?:number,ProjectName?:string,JobID?:number,JobName?:string,Quantity?:number,UsageDate?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Scope;
    /** @type {number} */
    ProjectID;
    /** @type {string} */
    ProjectName;
    /** @type {number} */
    JobID;
    /** @type {string} */
    JobName;
    /** @type {number} */
    Quantity;
    /** @type {string} */
    UsageDate;
}
export class MaterialUsageResponse {
    /** @param {{ResponseStatus?:ResponseStatus,Usage?:MaterialUsageEntry[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ResponseStatus} */
    ResponseStatus;
    /** @type {MaterialUsageEntry[]} */
    Usage = [];
}
export class MaterialUsageRequest {
    /** @param {{MaterialID?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    MaterialID;
}

JavaScript MaterialUsageRequest DTOs

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

HTTP + CSV

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

GET /v1/Material/{MaterialID}/usage HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Usage":[{"Scope":"String","ProjectID":0,"ProjectName":"String","JobID":0,"JobName":"String","Quantity":0,"UsageDate":"String"}]}