Events
Retrieve an event
Retrieves a specific event by ID.
GET
/
projects
/
{project_id}
/
events
/
{event_id}
Retrieve an event
curl --request GET \
--url https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id} \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "evt_mNoP3456qRsT7890",
"slug": "biochar-delivery",
"event_type": "Biochar Delivery",
"tracking_id": "MG1003",
"start_time": "2024-06-04T00:00:00.000Z",
"end_time": "2024-06-04T23:59:59.000Z",
"has_rule_alerts": true,
"data_points": [
{
"id": "in_mNoP3456qRsT7890",
"slug": "total-ash-delivered-wet-us-ton",
"data_point_type": "Total Ash Delivered (wet mass) U.S. ton",
"value": 290.6,
"unit": "U.S. ton",
"status": "complete",
"substituted": false,
"raw_value": null,
"substitution": null,
"rule_results": [
{
"id": "dpres_8kQ2mNvX1aBcDeFg",
"status": "fail",
"entered_value": "290.6",
"rule_id": "rule_4cd9b2f6e1a08",
"rule_version": 2,
"rule_name": "Ash delivered within expected range",
"data_point_id": "in_mNoP3456qRsT7890",
"data_point_slug": "total-ash-delivered-wet-us-ton",
"dismissed_at": null,
"dismissed_by": null,
"dismissal_reason": null,
"evaluated_at": "2024-06-04T12:00:00.000Z"
}
]
},
{
"id": "in_uVwX1234yZaB5678",
"slug": "distance-biochar-transported",
"data_point_type": "Biochar distance transported",
"value": 15.3,
"unit": "mile",
"status": "complete",
"substituted": true,
"raw_value": 12,
"substitution": {
"source": "rule",
"method": "fallback_to_dpt",
"from_value": 12,
"to_value": 15.3,
"created_at": "2024-06-04T12:00:00.000Z",
"created_by": null,
"rule": {
"name": "Distance within expected range",
"friendly_id": "rule_9ab1c2d3e4f56"
}
}
},
{
"id": "in_cDeF9012gHiJ3456",
"slug": "biochar-end-use",
"data_point_type": "Biochar end use",
"value": "soil amendment",
"unit": null,
"status": "complete",
"substituted": false,
"raw_value": null,
"substitution": null
}
],
"locations": [
{
"id": "loc_mNoP3456qRsT7890",
"lat": "40.4773493",
"long": "-124.1226179",
"name": "Production Facility",
"address": {
"name": "Production Facility",
"street_address_1": null,
"street_address_2": null,
"city": null,
"state": null,
"postal_code": null,
"country": "CA"
}
},
{
"id": "loc_mNoP3456qRsT7890",
"lat": "41.2733453",
"long": "-122.2246676",
"name": "Customer Location",
"address": {
"name": "Customer Location",
"street_address_1": null,
"street_address_2": null,
"city": null,
"state": null,
"postal_code": null,
"country": "CA"
}
}
],
"evidences": [
{
"id": 1,
"url": "XXXXXXX",
"evidence_type": "file",
"name": "Receipt.pdf"
}
],
"feedstock_id": null,
"asset_id": "asset_AAAAAAAAAAAAAAAA",
"asset": {
"id": "asset_AAAAAAAAAAAAAAAA",
"name": "Reactor A1"
}
}{
"status": "error",
"statusCode": 404,
"errors": [
{
"message": "record not found"
}
]
}⌘I
Retrieve an event
curl --request GET \
--url https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id} \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/projects/{project_id}/events/{event_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "evt_mNoP3456qRsT7890",
"slug": "biochar-delivery",
"event_type": "Biochar Delivery",
"tracking_id": "MG1003",
"start_time": "2024-06-04T00:00:00.000Z",
"end_time": "2024-06-04T23:59:59.000Z",
"has_rule_alerts": true,
"data_points": [
{
"id": "in_mNoP3456qRsT7890",
"slug": "total-ash-delivered-wet-us-ton",
"data_point_type": "Total Ash Delivered (wet mass) U.S. ton",
"value": 290.6,
"unit": "U.S. ton",
"status": "complete",
"substituted": false,
"raw_value": null,
"substitution": null,
"rule_results": [
{
"id": "dpres_8kQ2mNvX1aBcDeFg",
"status": "fail",
"entered_value": "290.6",
"rule_id": "rule_4cd9b2f6e1a08",
"rule_version": 2,
"rule_name": "Ash delivered within expected range",
"data_point_id": "in_mNoP3456qRsT7890",
"data_point_slug": "total-ash-delivered-wet-us-ton",
"dismissed_at": null,
"dismissed_by": null,
"dismissal_reason": null,
"evaluated_at": "2024-06-04T12:00:00.000Z"
}
]
},
{
"id": "in_uVwX1234yZaB5678",
"slug": "distance-biochar-transported",
"data_point_type": "Biochar distance transported",
"value": 15.3,
"unit": "mile",
"status": "complete",
"substituted": true,
"raw_value": 12,
"substitution": {
"source": "rule",
"method": "fallback_to_dpt",
"from_value": 12,
"to_value": 15.3,
"created_at": "2024-06-04T12:00:00.000Z",
"created_by": null,
"rule": {
"name": "Distance within expected range",
"friendly_id": "rule_9ab1c2d3e4f56"
}
}
},
{
"id": "in_cDeF9012gHiJ3456",
"slug": "biochar-end-use",
"data_point_type": "Biochar end use",
"value": "soil amendment",
"unit": null,
"status": "complete",
"substituted": false,
"raw_value": null,
"substitution": null
}
],
"locations": [
{
"id": "loc_mNoP3456qRsT7890",
"lat": "40.4773493",
"long": "-124.1226179",
"name": "Production Facility",
"address": {
"name": "Production Facility",
"street_address_1": null,
"street_address_2": null,
"city": null,
"state": null,
"postal_code": null,
"country": "CA"
}
},
{
"id": "loc_mNoP3456qRsT7890",
"lat": "41.2733453",
"long": "-122.2246676",
"name": "Customer Location",
"address": {
"name": "Customer Location",
"street_address_1": null,
"street_address_2": null,
"city": null,
"state": null,
"postal_code": null,
"country": "CA"
}
}
],
"evidences": [
{
"id": 1,
"url": "XXXXXXX",
"evidence_type": "file",
"name": "Receipt.pdf"
}
],
"feedstock_id": null,
"asset_id": "asset_AAAAAAAAAAAAAAAA",
"asset": {
"id": "asset_AAAAAAAAAAAAAAAA",
"name": "Reactor A1"
}
}{
"status": "error",
"statusCode": 404,
"errors": [
{
"message": "record not found"
}
]
}