Materials

Materials are types of items that are stored. When creating and updating materials, the changes need to be verified and updated asynchronously by PowerPick.

Attributes

  • id string

  • name string

    The name of the material.

  • status string

    If the material has been updated or created successfully.

  • creationDate datetime

    When this material was created.

  • reOrderPoint integer

    The minimum level of the material.

  • canOrderPoint integer

    An alternate minimum or maximum level of the material.

  • unitOfMeasure string

    What measurement is used.

  • weightPerUnit integer

    How much each material weighs.

  • valuePerUnit integer

    How much each individual material is worth.

  • isBlocked integer

    Whether the material is inactive.

  • info1 string

  • info2 string

  • info3 string

  • info4 string

  • info5 string

  • [DynamicField] string

    Any custom fields setup in PowerPick.

Endpoints

List Materials

/api/materials

Get the materials from the PPG database and return a JSON response.

Arguments

  • name string

    Only return materials that have the given name.

  • limit integer

    A limit on the number of objects to be returned. Limit can range between 1 and 1000, and the default is 25.

  • orderBy string, array

    Order the response by the selected field. Multiple values can be passed, separated by a comma.

  • countOnly boolean

    If set to true, will only return a count.

  • [dynamic_field]

    Any dynamic fields that have been set up can be used as a filter.

  • status string

    Only return order with a certain status.

Request with curl
curl "http://[Your IP] /api/materials" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "materials": [{ "id": "string", "name": "string", "status": "string", "creationDate": "datetime", "reOrderPoint": "integer", "canOrderPoint": "integer", "unitOfMeasure": "string", "weightPerUnit": "integer", "valuePerUnit": "integer", "isBlocked": "integer", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "[DynamicField]": "string", }] }

Create Material

/api/materials

Create a material and get a response.

Arguments

  • name string

    The name of the material.

  • materialProperty string

    The property assigned to this material.

  • supplementLink string

    The link to the image for this material.

  • creationDate string

    When this material was created.

  • reOrderPoint integer

    The minimum level of the material.

  • canOrderPoint integer

    An alternate minimum or maximum level of the material.

  • unitOfMeasure string

    What measurement is used.

  • weightPerUnit integer

    How much each material weighs at the unit level.

  • valuePerUnit integer

    How much the material is worth at the unit level.

  • isBlocked integer

    Whether the material is inactive.

  • info1 string

  • info2 string

  • info3 string

  • info4 string

  • info5 string

  • family string

    The name of a group this material belongs to.

  • [DynamicField] string

    Any dynamic field that is in PowerPick.

Request with curl
curl "http://[Your IP] /api/materials" \ -X post \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "materials": [{ "id": "string", "name": "string", "status": "string", "creationDate": "datetime", "reOrderPoint": "integer", "canOrderPoint": "integer", "unitOfMeasure": "string", "weightPerUnit": "integer", "valuePerUnit": "integer", "isBlocked": "integer", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "[DynamicField]": "string", }] }

Show Material

/api/materials/[id]

Get a specific material from the PPG database and return a JSON response. The order will be pulled from the Material table.

Arguments

Request with curl
curl "http://[Your IP] /api/materials/[id]" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "materials": [{ "id": "string", "name": "string", "status": "string", "creationDate": "datetime", "reOrderPoint": "integer", "canOrderPoint": "integer", "unitOfMeasure": "string", "weightPerUnit": "integer", "valuePerUnit": "integer", "isBlocked": "integer", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "[DynamicField]": "string", }] }

Update Material

/api/materials/[id]

Update a material and get a response. Each key/value is optional. Only keys sent will be updated, but an object is required to be sent.

Arguments

  • name string

    The name of the material.

  • reOrderPoint integer

    The minimum level of the material.

  • canOrderPoint integer

    The max level of the material.

  • unitOfMeasure string

    What measurement is used.

  • weightPerUnit integer

    How much each material weighs.

  • valuePerUnit integer

    How much each individual material is worth.

  • isBlocked integer

    Whether the material is inactive.

Request with curl
curl "http://[Your IP] /api/materials/[id]" \ -X put \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "materials": [{ "id": "string", "name": "string", "status": "string", "creationDate": "datetime", "reOrderPoint": "integer", "canOrderPoint": "integer", "unitOfMeasure": "string", "weightPerUnit": "integer", "valuePerUnit": "integer", "isBlocked": "integer", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "[DynamicField]": "string", }] }

Delete Material

/api/materials/[id]/delete

Delete a specific material from the PPG database and return a JSON response.

Arguments

Request with curl
curl "http://[Your IP] /api/materials/[id]/delete" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "materials": [{ "id": "string", "name": "string", "status": "string", "creationDate": "datetime", "reOrderPoint": "integer", "canOrderPoint": "integer", "unitOfMeasure": "string", "weightPerUnit": "integer", "valuePerUnit": "integer", "isBlocked": "integer", "info1": "string", "info2": "string", "info3": "string", "info4": "string", "info5": "string", "[DynamicField]": "string", }] }