AgriWebb API
API Reference

Create Report

POST
/v2/report

Create a report, then download it with Get Report once it has generated.

By default, repeating the same request within an hour returns the same report. Send Cache-Control: no-cache to always generate a new one, or set the window in seconds, as in Cache-Control: max-age=3600.

Header Parameters

authorization?string

An OAuth 2.0 access token, as Bearer {access token}. Send this or x-api-key.

x-api-key?string

An API key issued by AgriWebb. Send this or authorization.

cache-control?string

Control if or how long the report should be cached before generating a new one

Request Body

Body

application/json
  1. body
type*"animal-load-by-paddock.v1"
Value in"animal-load-by-paddock.v1"
tenantType*"farm"
Value in"farm"
tenantId*string
Length1 <= length
reportingPeriodStart*integer
Range0 <= value <= 9007199254740991
reportingPeriodEnd*integer
Range0 <= value <= 9007199254740991

Response Body

The new report, or the report with the same type, tenant and reporting period created within the cache window. Download it from links.download.

application/json
  1. response
data*
links*
curl -X POST "https://example.com/v2/report" \  -H "Content-Type: application/json" \  -d '{    "type": "animal-load-by-paddock.v1",    "tenantType": "farm",    "tenantId": "string",    "reportingPeriodStart": 0,    "reportingPeriodEnd": 0  }'
{  "data": {    "type": "animal-load-by-paddock.v1",    "tenantType": "farm",    "tenantId": "string",    "reportingPeriodStart": 0,    "reportingPeriodEnd": 0,    "id": "string",    "status": "pending",    "creationDate": 0,    "lastModifiedDate": 0  },  "links": {    "download": "https://api.agriwebb.com/v2/report/{id}"  }}