Task 'vnd.farmmaps.task.blight' must be executed to create an advice.
This task is automatically created for potato fields and is scheduled to run at configered times to keep the advice updated. But it is possible to create this task at any time.
Add the crop field code to the URL and execute the following request.
> Request
```javascript
POST /api/v1/items/{code}/tasks
{
"TaskType": "vnd.farmmaps.task.blight",
"Delay": null,
"attributes": {}
}
```
> Response 200
```javascript
{
"code": "{code}",
"taskType": "vnd.farmmaps.task.blight",
"attributes": {
"messagePriority": "10"
}
}
```
With the code in the response message and the code of the crop field, it is possible to check the task's state (error/ok/scheduled/processing). See [Check task status](Polling-task-status.md).
### Add spray
Sprays are stored as child item of a blight item.
This item also contains other parameters like pressure, disable/enable oospores and risc on tuber infection, wich are all used when the advice is created.
Changing these parameters will not create in a new advice automatically.
But is it possible to create an advice at any time, see [Create blight advice](#create-advice).
Get the blight advice code from [Get blight advice](#get-advice)
Use this code in the following request.
> Request
```javascript
GET api/v1/items/{code}/children?it=vnd.farmmaps.itemtype.user.input
```
> Response 200
```javascript
[
{
"code": "{code}",
// ....
"data": {
"sprays": [],
"phytoPressure": 0,
"ignoreOoSpores": true,
"ignoreTuberRisk": true,
"haulmKillingDate": null
}
}
```
Get the first objecy of the array, change the data, and push the object back.
Use the code from the response above.
```javascript
PUT /api/v1/items/{code}
{
"parentCode": "....",
// ....
"data": {
"sprays": [
{
"dose": 1,
"isVRA": false,
"fungicide": {
"ai1": "mandipropamid",
"ai2": null,
"ai3": null,
"code": "revus",
"name": "revus 0,6 l",
"maxdose": "0.6",
"mindose": "0.48",
"safedays": "3",
"emergence": true,
"newgrowth": "2",
"contentai1": "250",
"contentai2": "0",
"contentai3": "0",
"fastgrowth": true,
"contentunit": "g/l",
"rainfastness": "3",
"tuberfilling": false,
"aidescription": "mandipropamid (0.6 l/ha)",
"curativescore": "1",
"dryingtimemax": "1",
"dryingtimemin": "0.5",
"vracompatible": true,
"maxapplications": "6",
"preventivescore": "4",
"recommendeddose": "0.6",
"tuberprotection": "2",
"eradicativescore": "1.5",
"earlytubersetting": false,
"protectioncategory": "1",
"applicationrateunit": "l/ha",
"ctgbregistrationnumber": "12969 n"
},
"sprayTime": "2021-04-15T12:00:00Z"
}
],
"phytoPressure": 0,
"ignoreOoSpores": false,
"ignoreTuberRisk": true,
"haulmKillingDate": null
},
// ....
}
```
> Response 200
```javascript
{
"parentCode": "....",
// ....
}
```
### Add irrigation
Irrigations are stored as child item of a crop recording item.
First step is to get the crop recording item for the crop field.
#### 1. get the crop recording item for the crop field
> Request
```javascript
GET /api/v1/items/{code}/children?it=vnd.farmmaps.itemtype.crprec
```
> Response 200
```javascript
[
{
"code": "{code}",
// ....
"data":
{
}
}
```
#### 2. Add irrigation to the crop field
Use the crop recording code, got from the previous call, and change the desired fields (from, to, quantity, etc):