Reports
Was this helpful?
Was this helpful?
Retrieve existing report
/{app_id}/reports/{report_id}
curl -L \
--url '/api/v2/{app_id}/reports/{report_id}'
{
"description": "Example report description",
"project_id": 123,
"status": "FINISHED",
"title": "Example report title",
"inputs": {
"end_date": "2023-11-02",
"start_date": "2022-10-01"
},
"components": [
{
"id": 123,
"report_component_type": "layer",
"status": "FINISHED",
"data": {
"container_id": "123",
"maptiles_url": "https://example.com/z/x/y",
"name": "Layer name",
"widget_url": "https://example.com/widget/e/N4IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL5A",
"legend": {
"legend_type": "basic",
"items": [
{
"color": "#008000",
"title": "Value A"
},
{
"color": "#ffa500",
"title": "Value B"
}
]
}
}
},
{
"id": 124,
"report_component_type": "layer_group",
"status": "FINISHED",
"data": {
"container_id": "1234",
"name": "Layer group name",
"widget_url": "https://example.com/widget/e/N1IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL4A",
"layers": [
{
"maptiles_url": "https://example.com/z/x/y",
"name": "Layer name 1"
},
{
"maptiles_url": "https://example.com/z/x/y",
"name": "Layer name 2"
}
],
"legend": {
"legend_type": "basic",
"items": [
{
"color": "#008000",
"title": "Value A"
},
{
"color": "#ffa500",
"title": "Value B"
}
]
}
}
},
{
"id": 125,
"report_component_type": "chart",
"status": "FINISHED",
"data": {
"chart_url": "https://example.com/some_chart_data.csv",
"name": "Chart",
"widget_url": "https://example.com/widget/e/N2IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL1A",
"configuration": {
"chart_type": "bar",
"xaxis": {
"data_key": "xkey",
"data_type": "category"
},
"yaxis": {
"unit": "ha"
},
"bars": [
{
"color": "#ffc9c9",
"data_key": "key1",
"name": "Bar name"
}
]
}
}
},
{
"id": 126,
"report_component_type": "stat",
"status": "FINISHED",
"data": {
"name": "Stat",
"stat_type": "simple_stat",
"widget_url": "https://example.com/widget/e/D2IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL1B",
"computed_variables": {
"area_gain": 13,
"total_area": 1343
},
"configuration": {
"label": "Some label",
"unit": "C",
"value": "{{area_gain | divided_by: total_area}}"
}
}
},
{
"id": 127,
"report_component_type": "stat",
"status": "ERROR",
"data": {
"error": "Generic error",
"details": {
"message": "Generic error occurred"
}
}
}
]
}
Successful Response
Update existing report
/{app_id}/reports/{report_id}
Report title
Report description
Report inputs
Report public setting
Report refresh frequency, can be one of: MONTHLY, YEARLY, OFF
curl -L \
--request PUT \
--url '/api/v2/{app_id}/reports/{report_id}' \
--header 'Content-Type: application/json' \
--data '{
"description": "Example report description",
"title": "Example report title",
"inputs": {
"end_date": "2023-11-02",
"start_date": "2022-10-01"
}
}'
{
"description": "Example report description",
"project_id": 123,
"status": "FINISHED",
"title": "Example report title",
"inputs": {
"end_date": "2023-11-02",
"start_date": "2022-10-01"
},
"components": [
{
"id": 123,
"report_component_type": "layer",
"status": "FINISHED",
"data": {
"container_id": "123",
"maptiles_url": "https://example.com/z/x/y",
"name": "Layer name",
"widget_url": "https://example.com/widget/e/N4IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL5A",
"legend": {
"legend_type": "basic",
"items": [
{
"color": "#008000",
"title": "Value A"
},
{
"color": "#ffa500",
"title": "Value B"
}
]
}
}
},
{
"id": 124,
"report_component_type": "layer_group",
"status": "FINISHED",
"data": {
"container_id": "1234",
"name": "Layer group name",
"widget_url": "https://example.com/widget/e/N1IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL4A",
"layers": [
{
"maptiles_url": "https://example.com/z/x/y",
"name": "Layer name 1"
},
{
"maptiles_url": "https://example.com/z/x/y",
"name": "Layer name 2"
}
],
"legend": {
"legend_type": "basic",
"items": [
{
"color": "#008000",
"title": "Value A"
},
{
"color": "#ffa500",
"title": "Value B"
}
]
}
}
},
{
"id": 125,
"report_component_type": "chart",
"status": "FINISHED",
"data": {
"chart_url": "https://example.com/some_chart_data.csv",
"name": "Chart",
"widget_url": "https://example.com/widget/e/N2IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL1A",
"configuration": {
"chart_type": "bar",
"xaxis": {
"data_key": "xkey",
"data_type": "category"
},
"yaxis": {
"unit": "ha"
},
"bars": [
{
"color": "#ffc9c9",
"data_key": "key1",
"name": "Bar name"
}
]
}
}
},
{
"id": 126,
"report_component_type": "stat",
"status": "FINISHED",
"data": {
"name": "Stat",
"stat_type": "simple_stat",
"widget_url": "https://example.com/widget/e/D2IgDgTg9gVgpgYwC4EkAmIBcBGADAVgGYAaECOMKCVDTQ3ADlISgFtKA7ODmrAFnwMA7KQDuASzQBzOEgAqATzBwsZClSQB9FuyhceIAL1B",
"computed_variables": {
"area_gain": 13,
"total_area": 1343
},
"configuration": {
"label": "Some label",
"unit": "C",
"value": "{{area_gain | divided_by: total_area}}"
}
}
},
{
"id": 127,
"report_component_type": "stat",
"status": "ERROR",
"data": {
"error": "Generic error",
"details": {
"message": "Generic error occurred"
}
}
}
]
}
Successful Response
Delete existing report
/{app_id}/reports/{report_id}
curl -L \
--request DELETE \
--url '/api/v2/{app_id}/reports/{report_id}'
No body
Successful Response