Calibrations
Download Latest
Download the content of a latest calibration by its report ID. An older report returns 404.
GET
/
calibrations
/
latest
/
{report_id}
/
content
curl (Linux)
curl \
--unix-socket /run/miru/miru.sock \
--request GET \
--url http://localhost/v0.2/calibrations/latest/{report_id}/content$api = Get-Content -Raw "$env:ProgramData\Miru\device-api\device-api.json" | ConvertFrom-Json; `
Invoke-RestMethod -Method Get `
-Uri "http://127.0.0.1:$($api.port)/v0.2/calibrations/latest/{report_id}/content" `
-Headers @{ Authorization = "Bearer $($api.token)" }import requests
url = "http://localhost/v0.2/calibrations/latest/{report_id}/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost/v0.2/calibrations/latest/{report_id}/content', 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 => "http://localhost/v0.2/calibrations/latest/{report_id}/content",
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 := "http://localhost/v0.2/calibrations/latest/{report_id}/content"
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("http://localhost/v0.2/calibrations/latest/{report_id}/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/v0.2/calibrations/latest/{report_id}/content")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"Authorizations
The token from the agent's discovery file (%ProgramData%\Miru\device-api\device-api.json on Windows). Required over loopback TCP (127.0.0.1:6478 by default on Windows) and accepted by every route; not used over the Unix socket.
Path Parameters
The ID the agent gave the calibration report.
Example:
"0b6f3c2e-6a51-4e0f-9a43-2f1d7c9e8b10"
Response
200 - application/octet-stream
Successfully retrieved the calibration content. The Content-Type header is set according to the content format.
The raw calibration content, exactly as it was reported.
⌘I
curl (Linux)
curl \
--unix-socket /run/miru/miru.sock \
--request GET \
--url http://localhost/v0.2/calibrations/latest/{report_id}/content$api = Get-Content -Raw "$env:ProgramData\Miru\device-api\device-api.json" | ConvertFrom-Json; `
Invoke-RestMethod -Method Get `
-Uri "http://127.0.0.1:$($api.port)/v0.2/calibrations/latest/{report_id}/content" `
-Headers @{ Authorization = "Bearer $($api.token)" }import requests
url = "http://localhost/v0.2/calibrations/latest/{report_id}/content"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost/v0.2/calibrations/latest/{report_id}/content', 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 => "http://localhost/v0.2/calibrations/latest/{report_id}/content",
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 := "http://localhost/v0.2/calibrations/latest/{report_id}/content"
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("http://localhost/v0.2/calibrations/latest/{report_id}/content")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost/v0.2/calibrations/latest/{report_id}/content")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body"<string>"
