SDK Modules
The following modules allow you to interact with the different SDK components
General Data Module
Provides functions that provide general information about the user and about the farms and fields visible in the interface.
getUserData()
Provides general information about the user.
Parameters
No parameters required.
Returns
An object with all the information about the logged in user:
- id: string
- tipo_usuario: string
- datos: object
- nombre: string
- apellido: string
- email: string
- locale: string
- admin: boolean
- supervisor: boolean
getFarms()
Provides general information about the user's fields and farms.
Parameters
No parameters required.
Returns
Array of objects with information about each of the farms the user has access to:
- id: String
- nombre: String
- bounds: Array [ xmin, ymin, xmax, ymax ]
- permisos: Number[]
- role: Number
- supervised: Object[]
- lotes: Object[]
- id: number
- nombre: String
- country: String
- wkt: String
- bounds: Array [ xmin, ymin, xmax, ymax ]
- centroide: string
- area: Number
- permisos: Number[]
- role: Number
getFarmById()
Provides information about a specific farm.
Parameters
Parameter | Type | Description |
---|---|---|
farmID | number | id of the farm for which information is required |
Returns
Object with the requested farm information:
- id: number
- bounds: Array [ xmin, ymin, xmax, ymax ]
- nombre: string
- lotes: Array [object,...]
- id: number
- bounds: Array [ xmin, ymin, xmax, ymax ]
- centroide: string
- area: number
- nombre: string
- wkt: string
getFieldById()
Provides information about a specific field
Parameters
Parameter | Type | Description |
---|---|---|
fieldID | number | id of the field for which information is required |
Returns
Object with the requested field information:
- id: number
- bounds: Array [ xmin, ymin, xmax, ymax ]
- centroide: string
- area: number
- nombre: string
- wkt: string
getSpacesData()
Provides information about the space, if any, of the logged in user.
Parameters
No parameters required.
Returns
Object with the requested field information:
- id: number
- logo: string
- thumbnail: string
- color: string
- name: string
getGlobalUnits()
Provides the logged user units.
Parameters
No parameters required.
Returns
Array of objects with each unit data. Each object contains:
- group: string (The unit class group)
- description: string (Extended description of the unit)
- unit: string (Unit)