This is a development version of the documentation. Content may change without notice.
Voke Documentation
ReferenceREST API

Plant groups

Plant grouping and hierarchy

List plant groups

GET
/api/v1/plant-groups

Query Parameters

page?number

Page number (1-indexed)

Default1
Range1 <= value
limit?number

Items per page

Default20
Range1 <= value <= 100

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/api/v1/plant-groups"
{
  "data": [
    {
      "createdAt": "2019-08-24T14:15:22Z",
      "description": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "name": "string",
      "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
      "updatedAt": "2019-08-24T14:15:22Z"
    }
  ],
  "meta": {
    "limit": 0,
    "page": 0,
    "total": 0,
    "totalPages": 0
  }
}
{
  "code": "VALIDATION_ERROR",
  "details": {},
  "error": "Bad Request",
  "message": "Validation error",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

Create a plant group

POST
/api/v1/plant-groups

Request Body

application/json

description?string

Optional description

Lengthlength <= 500
name*string

Group display name

Length1 <= length <= 100

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/plant-groups" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "createdAt": "2019-08-24T14:15:22Z",
  "description": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "code": "VALIDATION_ERROR",
  "details": {},
  "error": "Bad Request",
  "message": "Validation error",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

Get plant group with plants

GET
/api/v1/plant-groups/{id}

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/api/v1/plant-groups/string"
{
  "createdAt": "2019-08-24T14:15:22Z",
  "description": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "code": "INVALID_UUID",
  "details": {},
  "error": "Bad Request",
  "message": "Invalid plant group UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

Update a plant group

PATCH
/api/v1/plant-groups/{id}

Path Parameters

id*string

Request Body

application/json

description?string

Optional description

Lengthlength <= 500
name?string

Group display name

Length1 <= length <= 100

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://loading/api/v1/plant-groups/string" \  -H "Content-Type: application/json" \  -d '{}'
{
  "createdAt": "2019-08-24T14:15:22Z",
  "description": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "organizationId": "7bc05553-4b68-44e8-b7bc-37be63c6d9e9",
  "updatedAt": "2019-08-24T14:15:22Z"
}
{
  "code": "BAD_REQUEST",
  "details": {},
  "error": "Bad Request",
  "message": "Validation error or invalid UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

Delete a plant group

DELETE
/api/v1/plant-groups/{id}

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/api/v1/plant-groups/string"
{
  "message": "string"
}
{
  "code": "INVALID_UUID",
  "details": {},
  "error": "Bad Request",
  "message": "Invalid plant group UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

List plants available to add to a group

GET
/api/v1/plant-groups/{id}/available-plants

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/api/v1/plant-groups/string/available-plants"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "serialNumber": "string",
    "status": "ONLINE"
  }
]
{
  "code": "INVALID_UUID",
  "details": {},
  "error": "Bad Request",
  "message": "Invalid plant group UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

List plants in a group

GET
/api/v1/plant-groups/{id}/plants

Path Parameters

id*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://loading/api/v1/plant-groups/string/plants"
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "serialNumber": "string",
    "status": "ONLINE"
  }
]
{
  "code": "INVALID_UUID",
  "details": {},
  "error": "Bad Request",
  "message": "Invalid plant group UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

Add plants to group

POST
/api/v1/plant-groups/{id}/plants

Path Parameters

id*string

Request Body

application/json

plantIds*array<>
Items1 <= items

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://loading/api/v1/plant-groups/string/plants" \  -H "Content-Type: application/json" \  -d '{    "plantIds": [      "497f6eca-6276-4993-bfeb-53cbbbba6f08"    ]  }'
{
  "message": "string"
}
{
  "code": "BAD_REQUEST",
  "details": {},
  "error": "Bad Request",
  "message": "Validation error or invalid UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}

Remove plants from group

DELETE
/api/v1/plant-groups/{id}/plants

Path Parameters

id*string

Request Body

application/json

plantIds*array<>
Items1 <= items

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X DELETE "https://loading/api/v1/plant-groups/string/plants" \  -H "Content-Type: application/json" \  -d '{    "plantIds": [      "497f6eca-6276-4993-bfeb-53cbbbba6f08"    ]  }'
{
  "message": "string"
}
{
  "code": "BAD_REQUEST",
  "details": {},
  "error": "Bad Request",
  "message": "Validation error or invalid UUID",
  "statusCode": 400
}
{
  "code": "UNAUTHORIZED",
  "details": {},
  "error": "Unauthorized",
  "message": "Unauthorized",
  "statusCode": 400
}
{
  "code": "FORBIDDEN",
  "details": {},
  "error": "Forbidden",
  "message": "Forbidden",
  "statusCode": 400
}
{
  "code": "NOT_FOUND",
  "details": {},
  "error": "Not Found",
  "message": "Plant group not found",
  "statusCode": 400
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "details": {},
  "error": "Internal Server Error",
  "message": "Internal server error",
  "statusCode": 400
}