Skip to content

Crops

Description

Fields

FieldDescriptionData Type
idUnique identifier for the objectInteger
nameName of the itemString
domainIdDomain identifierString
createdAtTimestamp of when the object was createdString
updatedAtTimestamp of the last update to the objectString
deletedAtTimestamp of when the object was deleted, or null if not deletedString or null

List Crops

http
GET /crops

Response

json
{
  "data": [
    {
      "id": 8,
      "name": "88-",
      "domainId": "AGG",
      "createdAt": "2024-12-19T11:59:50.810Z",
      "updatedAt": "2024-12-19T12:39:53.834Z",
      "deletedAt": null
    }
  ],
  "meta": {
    "itemsPerPage": 20,
    "totalItems": 8,
    "currentPage": 1,
    "totalPages": 1,
    "sortBy": [
      [
        "createdAt",
        "DESC"
      ]
    ]
  },
  "links": {
    "current": "http://api-dev.aggraria.digital/v1.0/crops?page=1&limit=20&sortBy=createdAt:DESC"
  }
}

Create Crops

http
POST /crops

Request body

json
{
  "id": 9,
  "name": "99"
}

Response body

json
{
  "id": 9,
  "name": "99",
  "domainId": "AGG",
  "updatedAt": "2024-12-20T01:31:31.728Z",
  "createdAt": "2024-12-20T01:31:31.728Z",
  "deletedAt": null
}

Update Crops

http
PATCH /crops/<id>

Request body

json
{
  "name": "99"
}

Response body

json
{
  "generatedMaps": [],
  "raw": [],
  "affected": 1
}

Delete Crops

http
DELETE /crops/<id>

Response body

json
{
  "generatedMaps": [],
  "raw": [],
  "affected": 1
}