Skip to content

Campaigns

Description

Fields

FieldDescriptionData Type
idUnique identifier for the objectInteger
nameName of the campaignsString
domainIdDomain identifierString
activeState if is activeBoolean
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 Campaigns

http
GET /campaigns

Response

json
{
  "data": [
    {
      "id": 6,
      "name": "2029",
      "domainId": "AGG",
      "active": false,
      "createdAt": "2024-12-16T09:08:12.537Z",
      "updatedAt": "2024-12-16T09:08:12.537Z",
      "deletedAt": null
    }
  ],
  "meta": {
    "itemsPerPage": 200,
    "totalItems": 6,
    "currentPage": 1,
    "totalPages": 1,
    "sortBy": [
      [
        "createdAt",
        "DESC"
      ]
    ]
  },
  "links": {
    "current": "http://api-dev.aggraria.digital/v1.0/campaigns?page=1&limit=200&sortBy=createdAt:DESC"
  }
}

Create Campaigns

http
POST /campaigns

Request body

json
{
  "id": 10,
  "name": "1010",
  "active": true
}

Response body

json
{
  "id": 10,
  "name": "1010",
  "domainId": "AGG",
  "active": true,
  "updatedAt": "2024-12-20T01:50:08.191Z",
  "createdAt": "2024-12-20T01:50:08.191Z",
  "deletedAt": null
}

Update Crops

http
PATCH /campaigns/<id>

Request body

json
{
  "name": "1010-",
  "active": false
}

Response body

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

Delete Crops

http
DELETE /campaigns/<id>

Response body

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