Download project document
curl --request GET \
--url https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file', 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://api.emidat.com/v2/projects/{id}/documents/{document_id}/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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://api.emidat.com/v2/projects/{id}/documents/{document_id}/file"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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://api.emidat.com/v2/projects/{id}/documents/{document_id}/file")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}Projects
Download project document
Downloads one of the project’s current reports, as an attachment
named after it; the Content-Type matches its format. Take the path
from document.url in GET /v2/projects/{id}/documents.
A report stops being downloadable once a newer report in the same format replaces it; list the documents again for the new one.
GET
/
v2
/
projects
/
{id}
/
documents
/
{document_id}
/
file
Download project document
curl --request GET \
--url https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file', 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://api.emidat.com/v2/projects/{id}/documents/{document_id}/file",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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://api.emidat.com/v2/projects/{id}/documents/{document_id}/file"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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://api.emidat.com/v2/projects/{id}/documents/{document_id}/file")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.emidat.com/v2/projects/{id}/documents/{document_id}/file")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body"<string>"{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}{
"msg": "supplier product requires a supplier plant",
"err_code": "err_supplier_product_missing_supplier_plant",
"entitlement_limit": {
"dimension": "users",
"usage": 123,
"limit": 123
},
"product_categories": [
"<string>"
],
"epd_category": 123,
"license_start": "2023-12-25",
"validation_errors": {}
}Authorizations
ApiKeyAuthOAuth2
Per-manufacturer API key in the X-API-Key header, format
emidat-{key_id}-{secret} where key_id is a random public handle.
Issued by an owner in the Emidat
dashboard; carries its own permission scopes, optional plant
restrictions, and optional expiry. A revoked, expired, or unknown key
returns 401. See the Authentication guide for details.
Path Parameters
Response
The report's file.
The response is of type file.
⌘I