Documentatie/Blight-API.md

88 lines
2.2 KiB
Markdown
Raw Normal View History

2021-05-28 14:16:01 +00:00
## Blight API
[<< Home](README.md)
For the currently available public FarmMaps API you can take a look at swagger: https://test.farmmaps.eu/swagger
## API flow
* Authenticate User
2021-05-28 14:58:47 +00:00
* Create cropping scheme (if not exists)
* Create crop field (if not exists)
* Get blight advice
* Create blight advice
* Update UserInput
* Add spray
* Add irrigation
2021-06-03 11:48:20 +00:00
### Steps
[Authentication](Authentication.md)
##### Optional
[Create Croppingscheme] -- todo
[Create Cropfield](Create-Cropfield.md)
###### Querying predefined fungicides.
A list of fungicices can be requested by getting the "vnd.farmmaps.itemtype.codelist.fm005" items from farmmaps.
> Request
```javascript
GET /api/v1/items/?it=vnd.farmmaps.itemtype.codelist.fm002
```
> Response 200
```javascript
[
{
"code": "....",
// ....
"data":
{
"ai1": "fluazinam",
"ai2": null,
"ai3": null,
"code": "shirlangold",
"name": "shirlan gold ",
"maxdose": "0.4",
"mindose": "0.32",
"safedays": "7",
"emergence": false,
"newgrowth": "0.5",
"contentai1": "500",
"contentai2": "0",
"contentai3": "0",
"fastgrowth": true,
"contentunit": "g/l",
"rainfastness": "2.5",
"tuberfilling": false,
"aidescription": "fluazinam (0.4 l/ha)",
"curativescore": "0",
"dryingtimemax": "2",
"dryingtimemin": "1",
"vracompatible": false,
"maxapplications": "10",
"preventivescore": "2.9",
"recommendeddose": "0.4",
"tuberprotection": "3.3",
"eradicativescore": "0",
"earlytubersetting": true,
"protectioncategory": "1",
"applicationrateunit": "l/ha",
"ctgbregistrationnumber": "14744 n"
}
},
...
]
```
2021-05-28 14:58:47 +00:00
2021-05-28 14:16:01 +00:00
* Task 'vnd.farmmaps.task.blight' must be executed to create an advice. This task is automatically created for crop fields with potato and is scheduled to run at configered times to keep the advice updated.
It is also possible to executed this task at any time through the API. This will be explained in the following chapters.
**Users can poll the task api to see if a task is completed**
**This can be achieved with the task execution id obtained from calling the 'ItemTask' API.**
[Poll task status](Polling-task-status.md)
**Users can query the API for child items of a cropfield to see what items it has.**