Kits

A kit contains one or materials, or other kits (multiple levels), with a quantity of each.

Attributes

  • id uuid

    Unique identifier for the object.

  • name string

    The name of the kit.

  • hasStock integer

    If there is enough stock to fulfill the kit. 0=False, 1=True.

Endpoints

List Kits

get /api/kits

Get a list of all kits, at all levels (including kits within kits).

Arguments

  • name string

    Only return items that have the given name.

  • hasStock integer

    If there is enough stock to fulfill the kit. 0=False, 1=True.

  • limit integer

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

  • offset integer

    Will return items, but only those after the integer amount.

  • countOnly boolean

    When true, will only return a count of the amount of items in the query.

  • orderBy string

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

Request with curl
curl "http://[Your IP] /api/kits" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "kits": [{ "id": " uuid ", "name": " string ", "hasStock": " integer ", }] }] }

Create Kit

post http://api/kits

Create a kit of materials or other kits. An array of at least one kit line is required. For fields on the kit lines level, click here.

Body Parameters

  • name string REQUIRED

    The unique kit name/number.

  • target string

Request with curl
curl "http://[Your IP] http://api/kits" \ -X post \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]" \ -d '{ "name": "string", }'
Example Response
{ "kit": { "id": " uuid ", "name": " string ", "hasStock": " integer ", } }

Show Kit

get /api/kits/[id]

Get a single kit from the PPG database and return a JSON response with the kit lines.

Arguments

Request with curl
curl "http://[Your IP] /api/kits/[id]" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "kit": { "id": uuid , "name": " string " , "hasStock": integer , } }

Update Kit

put http://api/kits

Update a kit by calling its ID and get a response. Each key/value is optional. Only keys sent will be updated.

Arguments

  • name string REQUIRED

    The unique kit name/number.

  • target string

Request with curl
curl "http://[Your IP] http://api/kits" \ -X put \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "kit": { "id": " uuid ", "name": " string ", "hasStock": " integer ", } }

Delete Kit

get /api/kits/[id]/delete

Delete a kit by calling its ID.

Arguments

Request with curl
curl "http://[Your IP] /api/kits/[id]/delete" \ -X get \ -H "Content-Type: application/json" \ -H "Authorization: Bearer [Your JWT Access Token]"
Example Response
{ "deleted": "true" }