2020-03-10 10:56:18 +00:00
|
|
|
## VRAPoten API v0.1.1
|
2020-01-20 13:44:34 +00:00
|
|
|
[<< Home](https://git.akkerweb.nl/FarmMaps/Documentatie/wiki/Home)
|
|
|
|
|
2020-03-10 08:39:30 +00:00
|
|
|
FarmMaps is an asynchronous architecture, the API flow keeps this in mind.
|
|
|
|
The API expects that all data is already processed and available provided, for example through the normal FarmMaps flow.
|
|
|
|
|
|
|
|
For the currently available public FarmMaps API you can take a look at swagger: http://farmmaps.awtest.nl/swagger/index.html
|
|
|
|
|
2020-01-20 13:44:34 +00:00
|
|
|
**Input preperation**
|
|
|
|
* VRAPoten requires specific input which needs to be provided by the FarmMaps API or user interface.
|
|
|
|
* You can activate the VRAPotenTask with the Task API, passing the just created cropfield item code as a parameter.
|
|
|
|
* Users can upload their own soilmaps if needed. (in case of when FarmMaps has not processed the required data).
|
|
|
|
* The file API can be used for this.
|
|
|
|
|
2020-03-20 11:22:18 +00:00
|
|
|
**Users can poll the task api to see if a task is completed**
|
2020-01-20 13:44:34 +00:00
|
|
|
**This can be achieved with the task execution id obtained from calling the 'ItemTask' API.**
|
2020-03-20 11:22:44 +00:00
|
|
|
[Poll task status](https://git.akkerweb.nl/FarmMaps/Documentatie/wiki/Polling-task-status)
|
2020-01-20 13:44:34 +00:00
|
|
|
|
|
|
|
### API flow
|
|
|
|
* Authenticate User
|
|
|
|
* *Create cropfield through FarmMaps API (optioneel)*
|
|
|
|
* Item 'FOLDER' must be created for parent to cropfields.
|
|
|
|
* Item 'vnd.farmmaps.itemtype.cropfield' must be created with its data as specified in the api.
|
|
|
|
* Task 'vnd.farmmaps.task.workflow' needs to be executed to aggregate all needed data.
|
|
|
|
* This is an asynchronous process and can take a while before all data is collected in FarmMaps.
|
|
|
|
* Upload own soil data (optioneel)
|
|
|
|
* Task 'vnd.farmmaps.task.vrapoten' must be executed to create an appliance map.
|
|
|
|
* Task 'vnd.farmmaps.task.taskmap' must be executed to create a taskmap.
|
|
|
|
* Download item data (tiff of shape)
|
|
|
|
|
|
|
|
### Steps
|
|
|
|
###### Authentication
|
2020-03-10 11:04:18 +00:00
|
|
|
[Authentication](https://git.akkerweb.nl/FarmMaps/Documentatie/wiki/Authentication)
|
2020-01-20 13:44:34 +00:00
|
|
|
|
2020-03-10 10:57:00 +00:00
|
|
|
###### Create cropfield with FarmMaps API (optional)
|
2020-03-10 11:04:18 +00:00
|
|
|
[Create Cropfield](https://git.akkerweb.nl/FarmMaps/Documentatie/wiki/Create-Cropfield)
|
2020-01-20 13:44:34 +00:00
|
|
|
|
2020-03-10 10:57:00 +00:00
|
|
|
###### Uploading own data (optional)
|
2020-03-10 11:04:18 +00:00
|
|
|
[Upload Data](https://git.akkerweb.nl/FarmMaps/Documentatie/wiki/Upload-Data)
|
2020-01-20 13:44:34 +00:00
|
|
|
|
|
|
|
###### Creating appliance maps
|
2020-02-23 19:53:39 +00:00
|
|
|
Execute the VRAPotenTask with the item code of the cropfield as parameter inside {code}.
|
|
|
|
Use the input map code inside {itemCode}, specifying an inputCode is optional.
|
2020-02-23 19:53:20 +00:00
|
|
|
In case of no specified inputCode the BOFEK data is looked up and if it could not be found the task gives an error.
|
2020-01-20 13:44:34 +00:00
|
|
|
|
|
|
|
> Request
|
|
|
|
```javascript
|
|
|
|
POST /api/v1/items/{code}/tasks
|
|
|
|
{
|
|
|
|
"taskType": "vnd.farmmaps.task.vrapoten",
|
|
|
|
"attributes": {
|
|
|
|
"inputCode": "{itemCode}",
|
|
|
|
"meanDensity": "30",
|
|
|
|
"variation": "20"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
> Response 201
|
|
|
|
```javascript
|
|
|
|
{
|
|
|
|
"code": "string",
|
|
|
|
"taskType": "vnd.farmmaps.task.workflow",
|
|
|
|
"delay": "",
|
|
|
|
"attributes": {
|
|
|
|
"additionalProp1": "string",
|
|
|
|
"additionalProp2": "string",
|
|
|
|
"additionalProp3": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
Response 400 Tasktype not found
|
|
|
|
Response 401 Not authenticated
|
|
|
|
Response 403 No WRITE permissions in item
|
|
|
|
Response 404 Item not found
|
|
|
|
|
|
|
|
###### Create taskmap
|
2020-03-10 10:59:10 +00:00
|
|
|
[Create Taskmap](https://git.akkerweb.nl/FarmMaps/Documentatie/wiki/Create-Taskmap)
|
2020-01-20 13:44:34 +00:00
|
|
|
|
2020-03-10 10:58:01 +00:00
|
|
|
###### Download the data
|
2020-03-10 11:01:43 +00:00
|
|
|
In case the data is available it can be downloaded with the File API.
|
2020-01-20 13:44:34 +00:00
|
|
|
> Request
|
|
|
|
```javascript
|
|
|
|
GET /api/v1/items/{itemcode}/data
|
|
|
|
```
|