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.

    Default value: 250

  • page integer

    Page-numbering is based on the value of the "limit" argument. If limit=20, then page=0 will display the hits from 1 to 20. (Page numbers are zero-based.) Using page without a limit returns all items.

  • orderBy string

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

  • countOnly boolean

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

    Default value: false

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

delete /api/kits/[id]/delete

Delete a kit by calling its ID.

Arguments

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