Update Fields
For a better understanding of how you can implement the API into your software see Get Started
Description
This route is used to add or remove services (NDVI, NDWI, etc...) of a given field. you can also use it to update the field's group name.
Endpoints
- /fields/update
Method type
POST
(Json only)
Parameters
name | description | type | Required | Default Value |
---|---|---|---|---|
token | Your identification token | string | required | |
field_name | Name of the field to update | string | optional | |
label | List of services and groupname to include. This list will replace the old one | list | required |
Responses
status code | description |
---|---|
200 | The request has succeeded |
400 | Wrong inputs or a required parameter is missing |
500 | Unexpected error |
Example Request
POST https://spacesense-api.ew.r.appspot.com/fields/update?token=__myToken__
Body of the request : (Json
)
{
"field_name":"farm_9",
"label":["NDVI","NDWI","Farmer-34"]
}
Example Response
{
"area (ha)": "15.79",
"field_name": "farm_9",
"geojson": "{'type': 'Feature','properties': {},'geometry': {'type':'Polygon','coordinates': [[[-4.391269683837891, 39.71808094723828],[-4.388244152069092, 39.71149505915214],[-4.3865275382995605,39.7120727937937],[-4.387707710266113, 39.717800358315465],[-4.391269683837891, 39.71808094723828]]]}}",
"label": "{'ndvi', 'ndwi', 'Farmer-34', 'username'}",
"message": "Field farm_9 is updated",
"group": null,
"username": "username"
}