Skip to main content

API Reference

tip

Refer to the Authentication Page for details on generating an authentication token (JWT)

Create Job API

 POST /solutions/bayerAgPowered.historicalWeather:create

Create Request

Request Headers

{
"Content-Type": "application/json",
"Authorization": "Bearer <TOKEN>"
}

Sample Request Body - daily data

{
"requestPath": "/v1/historical-weather-data/<User Defined Unique Batch ID>", # Something like 05172024-004
"partnerRequestBody": {
"interval": "daily",
"partyId": "53b8f2b9-04b3-4462-ac52-9c821feb0ee2",
"jobs": [
{
"resourceType": "Field",
"resourceId": "83b8f2b9-04b3-4462-ac52-9c821feb0ee21",
"weatherStartDate": "2018-01-01",
"weatherEndDate": "2018-04-30",
"temperatureUnit": "C"
}
]
}

Sample Request Body - hourly data

{
"requestPath": "/v1/historical-weather-data/<User Defined Unique Batch ID>", # Something like 05172024-004
"partnerRequestBody": {
"interval": "hourly",
"partyId": "53b8f2b9-04b3-4462-ac52-9c821feb0ee2",
"jobs": [
{
"resourceType": "Field",
"resourceId": "83b8f2b9-04b3-4462-ac52-9c821feb0ee21",
"weatherStartDateTime": "2018-05-01T00:00:00",
"weatherEndDateTime": "2018-06-01T00:00:00",
"temperatureUnit": "C"
}
]
}

Sample Request Body - with coordinates

{
"requestPath": "/v1/historical-weather-data/<User Defined Unique Batch ID>", # Something like 05172024-004
"partnerRequestBody": {
"interval": "daily",
"partyId": "53b8f2b9-04b3-4462-ac52-9c821feb0ee2",
"jobs": [
{
"resourceType": "Field",
"weatherStartDate": "2018-01-01",
"weatherEndDate": "2018-04-30",
"temperatureUnit": "C",
"coordinates": {
"lat": "-38.47280845505972",
"lng": "-62.18086966040869"
}
}
]
}

Request Body Parameters

ParameterDescription
requestPath
String
Request path containing api-version, query parameters and path route to be called for partner
Example: /v1/historical-weather-data/<User Defined Unique Job ID>
partnerRequestBody
String
Object with all required body parameters to create a GDD APS job
Details: See partnerRequestBody Parameters

partnerRequestBody Parameters

Required Parameters
ParameterDescription
partyId
String
The ID of the ADMA Party resource associated with the Field Resource used in the request.
Example: "53b8f2b9-04b3-4462-ac52-9c821feb0ee2"
interval
String
Interval being used to request historical weather data for.
Options: "daily", "hourly"
resourceType
String
The type of ADMA resource being used to request historical weather data for.
Options: "Field"
weatherStartDate
String
The start date being used to request historical weather daily data for. Must be in local time of requested location.
Example: "2023-07-01"
weatherEndDate
String
The end date being used to request historical weather data daily for. Must be in local time of requested location.
Example: "2023-07-15"
weatherStartDateTime
String
The start date being used to request historical weather hourly data for. Must be in local time of requested location.
Example: "2023-07-01T00:00:00"
weatherEndDateTime
String
The end date being used to request historical weather hourly data for. Must be in local time of requested location.
Example: "2023-07-15T00:00:00"
resourceId
String
The ID of the ADMA resource type (ie. "Field") used to request historical weather data for. Either resourceId or coordiantes to be provided in the request.
Example: "4b879eea-1c04-45c5-8669-cb608529c0f8"
lat
String
The latitude of the location used to request historical weather data for. Either resourceId or coordiantes to be provided in the request.
Example: "4b879eea-1c04-45c5-8669-cb608529c0f8"
lng
String
The longitude of the location used to request historical weather data for. Either resourceId or coordiantes to be provided in the request.
Example: "4b879eea-1c04-45c5-8669-cb608529c0f8"

Optional Parameters
ParameterDescription
temperatureUnit
String
The temperature unit being used to request historical weather data for.
Options: C, F; Default: 'C'

Response

Response Sample: 202 Accepted

{
"batchId": "05172024-004",
"e2eId": "426",
"interval": "DAILY",
"partyId": "53b8f2b9-04b3-4462-ac52-9c821feb0ee2",
"jobs": [
{
"jobRequestBody": {
"jobId": "1",
"resourceId": "83b8f2b9-04b3-4462-ac52-9c821feb0ee21",
"resourceType": "FIELD",
"weatherStartDate": "2018-01-01",
"weatherEndDate": "2018-04-30",
"temperatureUnit": "C",
"coordinates": {
"lat": -35.9551252,
"lng": -62.664814
}
},
"message": "HWA-01001: Job queued successfully.",
"status": "WAITING",
"jobCreatedDateTime": "2024-06-12T15:44:26Z",
"jobLastActionDateTime": "2024-06-12T15:44:26Z"
}
]
}

Error Response Sample

{
"errors": [
{
"code": "HWA-04090",
"message": "HWA-04090: Batch with BatchId [<ADMA Instance URL>, 1234] already exists."
}
],
"traceId": "7af4e84d-aac0-43a3-ba69-40a0347e9752"
}

{
"errors": [
{
"code": "HWA-04050",
"message": "HWA-04050: Either resourceId or coordinates must be present in job request.",
"target": "resourceId"
}
],
"traceId": "7af4e84d-aac0-43a3-ba69-40a0347e9753"
}

Fetch Status API

 POST /solutions/bayerAgPowered.historicalWeather:fetch

Fetch Request

Request Headers

{
"Content-Type": "application/json",
"Authorization": "Bearer <TOKEN>"
}

See Authorization Documentation for details on generating a JWT Token

Sample Request Body

{
"requestPath":"/v1/historical-weather-data/<User Defined Unique Batch ID>", # Something like 05172024-004
}

Request Body Parameters

ParameterDescription
requestPath
String
Request path containing api-version, query parameters and path route to be called for partner
Example: /v1/historical-weather-data/<User Defined Unique Batch ID>

Response

Response Sample

{
"batchId": "05172024-004",
"e2eId": "426",
"interval": "DAILY",
"partyId": "53b8f2b9-04b3-4462-ac52-9c821feb0ee2",
"jobs": [
{
"jobRequestBody": {
"jobId": "1",
"resourceId": "83b8f2b9-04b3-4462-ac52-9c821feb0ee21",
"resourceType": "FIELD",
"weatherStartDate": "2018-01-01",
"weatherEndDate": "2018-04-30",
"temperatureUnit": "C",
"coordinates": {
"lat": -35.9551252,
"lng": -62.664814
}
},
"insightId": "2e130d6c-13ae-4e2e-875b-3a8f018f1ffd",
"message": "HWA-02001: Job is completed successfully.",
"status": "SUCCEEDED",
"jobCreatedDateTime": "2024-06-12T15:44:26Z",
"jobProcessingStartDateTime": "2024-06-12T15:44:27Z",
"jobProcessingEndDateTime": "2024-06-12T15:44:51Z",
"jobLastActionDateTime": "2024-06-12T15:44:51Z",
"jobProcessingDurationInSeconds": 23
}
]
}

Error Response Sample

{
"errors": [
{
"code": "HWA-04101",
"message": "HWA-04101: Batch not found BatchId [<ADMA Instance URL>, 1234]."
}
],
"traceId": "7af4e84d-aac0-43a3-ba69-40a0347e9753"
}

Cancel Job API

 POST /solutions/bayerAgPowered.historicalWeather:cancel

Cancel Request

Request Headers

{
"Content-Type": "application/json",
"Authorization": "Bearer <TOKEN>"
}

See Authorization Documentation for details on generating a JWT Token

Sample Request Body

{
"requestPath":"/v1/historical-weather-data/<User Defined Unique Batch ID>", # Something like 12_04_23_1000
}

Request Body Parameters

ParameterDescription
requestPath
String
Request path containing api-version, query parameters and path route to be called for partner
Example: /v1/historical-weather-data/<User Defined Unique Batch ID>

Response

Response Sample

{
"batchId": "05172024-004",
"e2eId": "426",
"interval": "DAILY",
"partyId": "53b8f2b9-04b3-4462-ac52-9c821feb0ee2",
"jobs": [
{
"jobRequestBody": {
"jobId": "1",
"resourceId": "83b8f2b9-04b3-4462-ac52-9c821feb0ee21",
"resourceType": "FIELD",
"weatherStartDate": "2018-01-01",
"weatherEndDate": "2018-04-30",
"temperatureUnit": "C",
"coordinates": {
"lat": -35.9551252,
"lng": -62.664814
}
},
"insightId": "2e130d6c-13ae-4e2e-875b-3a8f018f1ffd",
"message": "HWA-02001: Job is completed successfully.",
"status": "CANCELLED",
"jobCreatedDateTime": "2024-06-12T15:44:26Z",
"jobProcessingStartDateTime": "2024-06-12T15:44:27Z",
"jobProcessingEndDateTime": "2024-06-12T15:44:51Z",
"jobLastActionDateTime": "2024-06-12T15:44:51Z",
"jobProcessingDurationInSeconds": 23
}
]
}

Error Response Sample

{
"errors": [
{
"code": "HWA-04101",
"message": "HWA-04101: Batch not found BatchId [<ADMA Instance URL>, 1234]."
}
],
"traceId": "7af4e84d-aac0-43a3-ba69-40a0347e9753"
}