emissions
Get Emissions Dashboard
Get a summary of emissions filtered by company, date range, categories, buildings and entities.
GET
/
api
/
v1
/
emissions
/
dashboard
Get Emissions Dashboard
curl --request GET \
--url https://www.manglai.io/api/v1/emissions/dashboard \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.manglai.io/api/v1/emissions/dashboard"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.manglai.io/api/v1/emissions/dashboard', 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://www.manglai.io/api/v1/emissions/dashboard",
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: Bearer <token>"
],
]);
$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://www.manglai.io/api/v1/emissions/dashboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.manglai.io/api/v1/emissions/dashboard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.manglai.io/api/v1/emissions/dashboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"monthly": {
"[ month: string ]": {
"building": {},
"category": {},
"categoryByBuilding": {},
"company": {},
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
}
}
},
"company": {
"[ companyId: string ]": 123
},
"building": {
"[ buildingId: string ]": 123
},
"category": {
"[ categoryCode: string ]": {
"id": "<string>",
"color": "<string>",
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
},
"name": "<string>",
"code": "<string>",
"parents": {
"[ parentType: string ]": "<string>"
}
}
},
"total": {
"total": {
"emissions": 123,
"numberOfEmissions": 123
}
},
"scope": {
"[ scopeCode: string ]": {
"id": "<string>",
"color": "<string>",
"emissionSources": [
"<string>"
],
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
},
"name": "<string>",
"code": "<string>"
}
},
"subcategory": {
"[ subcategoryCode: string ]": {
"id": "<string>",
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
},
"name": "<string>",
"code": "<string>",
"color": "<string>",
"parents": {
"[ parentType: string ]": "<string>"
},
"emissionSources": [
"<string>"
]
}
}
}Autorizaciones
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parámetros de consulta
CompanyId
List of category id
List of building id
List of consumptions
Include country-level data
Page number
Maximum number of items per page
Respuesta
200 - application/json
A summary of emissions
⌘I
Get Emissions Dashboard
curl --request GET \
--url https://www.manglai.io/api/v1/emissions/dashboard \
--header 'Authorization: Bearer <token>'import requests
url = "https://www.manglai.io/api/v1/emissions/dashboard"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://www.manglai.io/api/v1/emissions/dashboard', 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://www.manglai.io/api/v1/emissions/dashboard",
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: Bearer <token>"
],
]);
$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://www.manglai.io/api/v1/emissions/dashboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://www.manglai.io/api/v1/emissions/dashboard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.manglai.io/api/v1/emissions/dashboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"monthly": {
"[ month: string ]": {
"building": {},
"category": {},
"categoryByBuilding": {},
"company": {},
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
}
}
},
"company": {
"[ companyId: string ]": 123
},
"building": {
"[ buildingId: string ]": 123
},
"category": {
"[ categoryCode: string ]": {
"id": "<string>",
"color": "<string>",
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
},
"name": "<string>",
"code": "<string>",
"parents": {
"[ parentType: string ]": "<string>"
}
}
},
"total": {
"total": {
"emissions": 123,
"numberOfEmissions": 123
}
},
"scope": {
"[ scopeCode: string ]": {
"id": "<string>",
"color": "<string>",
"emissionSources": [
"<string>"
],
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
},
"name": "<string>",
"code": "<string>"
}
},
"subcategory": {
"[ subcategoryCode: string ]": {
"id": "<string>",
"emissions": 123,
"numberOfEmissions": 123,
"uncertainty": {
"fe": 123,
"da": 123
},
"name": "<string>",
"code": "<string>",
"color": "<string>",
"parents": {
"[ parentType: string ]": "<string>"
},
"emissionSources": [
"<string>"
]
}
}
}
