Documentatie/Blight-API.md

2.2 KiB

Blight API

<< Home

For the currently available public FarmMaps API you can take a look at swagger: https://test.farmmaps.eu/swagger

API flow

  • Authenticate User
  • Create cropping scheme (if not exists)
  • Create crop field (if not exists)
  • Get blight advice
  • Create blight advice
  • Update UserInput
  • Add spray
  • Add irrigation

Steps

Authentication

Optional

[Create Croppingscheme] -- todo Create Cropfield

Querying predefined fungicides.

A list of fungicices can be requested by getting the "vnd.farmmaps.itemtype.codelist.fm005" items from farmmaps.

Request

GET /api/v1/items/?it=vnd.farmmaps.itemtype.codelist.fm002

Response 200

[
{   
    "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"
    }
},
...
]
  • 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

Users can query the API for child items of a cropfield to see what items it has.