Get the company metrics report
Return the KPI report of the authenticated company as JSON: use it to summarise the company’s situation, build a report or answer how-many questions at a glance. report holds the headline counts (devices in use, assigned or not, and in stock; employees to enroll or enrolled; devices with MDM on, off or in another MDM; compliance issues; disk encryption; EDR; online and offline devices; employees to onboard and to offboard), each next to the cockpit table that lists them, and leaves out a count equal to 0. companyMetrics holds every raw counter the report is built from, zeros included, plus the connected apps and the SaaS identities. Through MCP, the counters of a domain the caller cannot read (equipment, employees, SaaS) are left out of report and null in companyMetrics. These are counts only: to list the devices, employees, onboardings or offboardings behind a count, use getDevices, getEmployees, getOnboardings or getOffboardings instead; for the compliance issues themselves, use getComplianceAlerts. Only accessible with a Company API key.
curl --request GET \
--url https://api.getprimo.com/company/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getprimo.com/company/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getprimo.com/company/metrics', 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.getprimo.com/company/metrics",
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://api.getprimo.com/company/metrics"
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://api.getprimo.com/company/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/company/metrics")
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{
"report": {
"devicesInUseAssignedURL": "<string>",
"devicesInUseUnassignedURL": "<string>",
"devicesInStockURL": "<string>",
"employeesToEnrollURL": "<string>",
"employeesEnrolledURL": "<string>",
"employeesToOnboardURL": "<string>",
"employeesToOffboardURL": "<string>",
"devicesWithMDMOnURL": "<string>",
"devicesWithMDMOnInAnotherMDMURL": "<string>",
"devicesWithMDMOffURL": "<string>",
"devicesWithMissingAgentURL": "<string>",
"devicesWithReadyZTDURL": "<string>",
"devicesNotEncryptedURL": "<string>",
"devicesWithoutRecoveryKeyURL": "<string>",
"devicesWithIcloudLockIssueURL": "<string>",
"devicesWithActiveEDRURL": "<string>",
"devicesWithEdrActivationIssueURL": "<string>",
"devicesWithEdrInactiveURL": "<string>",
"devicesOnlineURL": "<string>",
"devicesOfflineURL": "<string>",
"devicesOffline7dURL": "<string>",
"devicesInUseAssignedCount": 0,
"devicesInUseUnassignedCount": 0,
"devicesInStockCount": 0,
"employeesCount": 0,
"employeesToEnrollCount": 0,
"employeesEnrolledCount": 0,
"employeesToOnboardOrOffboardCount": 0,
"employeesToOnboardCount": 0,
"employeesToOnboardThisWeekCount": 0,
"employeesToOffboardCount": 0,
"employeesToOffboardThisWeekCount": 0,
"devicesWithMDMOnCount": 0,
"devicesWithMDMOnInAnotherMDMCount": 0,
"devicesWithMDMOffCount": 0,
"devicesWithMissingAgentCount": 0,
"devicesWithReadyZTDCount": 0,
"devicesCompliantCount": 0,
"devicesWithIssuesCount": 0,
"devicesNotEncryptedCount": 0,
"devicesWithoutRecoveryKeyCount": 0,
"devicesWithIcloudLockIssueCount": 0,
"edrEnabled": true,
"devicesWithActiveEDRCount": 0,
"devicesWithEdrNotDetectedCount": 0,
"devicesWithEdrNotDetectedURL": "<string>",
"devicesWithEdrActivationIssueCount": 0,
"devicesWithEdrInactiveCount": 0,
"devicesOnlineCount": 0,
"devicesOfflineCount": 0,
"devicesOffline7dCount": 0
},
"companyMetrics": {
"id": "<string>",
"countConnectedApps": 0,
"countCurrentEmployees": 0,
"deviceMdm": {
"countMdmOn": 0,
"countMdmOff": 0,
"countMdmOnInAnotherMdm": 0,
"countMissingAgent": 0,
"countReadyZTD": 0
},
"deviceEdr": {
"countNotDetected": 0,
"countInstallIncomplete": 0,
"countActivationIssues": 0,
"countOfflineFor7Days": 0,
"countActive": 0
},
"deviceCompliance": {
"countCompliant": 0,
"countIssuesExist": 0,
"countCompliantByAlertCount": 0,
"countIssuesExistByAlertCount": 0
},
"deviceComplianceDetails": {
"countToEncrypt": 0,
"countWithoutRecoveryKey": 0,
"countWithIcloudLockIssue": 0
},
"employeeEnrollment": {
"countToEnroll": 0,
"countEnrolled": 0
},
"deviceAssignment": {
"countInUseAssigned": 0,
"countInUseUnassigned": 0,
"countInStock": 0
},
"deviceOnline": {
"countOnline": 0,
"countOffline": 0,
"countOfflineFor7Days": 0
},
"identitiesAndAccess": {
"countAssignedToEmployee": 0,
"countAssignedToMachine": 0,
"countAssignedToGroup": 0,
"countAssignedToGuest": 0,
"countAssignedToContractor": 0,
"countToLink": 0
}
}
}Authorizations
Response
curl --request GET \
--url https://api.getprimo.com/company/metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getprimo.com/company/metrics"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getprimo.com/company/metrics', 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.getprimo.com/company/metrics",
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://api.getprimo.com/company/metrics"
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://api.getprimo.com/company/metrics")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getprimo.com/company/metrics")
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{
"report": {
"devicesInUseAssignedURL": "<string>",
"devicesInUseUnassignedURL": "<string>",
"devicesInStockURL": "<string>",
"employeesToEnrollURL": "<string>",
"employeesEnrolledURL": "<string>",
"employeesToOnboardURL": "<string>",
"employeesToOffboardURL": "<string>",
"devicesWithMDMOnURL": "<string>",
"devicesWithMDMOnInAnotherMDMURL": "<string>",
"devicesWithMDMOffURL": "<string>",
"devicesWithMissingAgentURL": "<string>",
"devicesWithReadyZTDURL": "<string>",
"devicesNotEncryptedURL": "<string>",
"devicesWithoutRecoveryKeyURL": "<string>",
"devicesWithIcloudLockIssueURL": "<string>",
"devicesWithActiveEDRURL": "<string>",
"devicesWithEdrActivationIssueURL": "<string>",
"devicesWithEdrInactiveURL": "<string>",
"devicesOnlineURL": "<string>",
"devicesOfflineURL": "<string>",
"devicesOffline7dURL": "<string>",
"devicesInUseAssignedCount": 0,
"devicesInUseUnassignedCount": 0,
"devicesInStockCount": 0,
"employeesCount": 0,
"employeesToEnrollCount": 0,
"employeesEnrolledCount": 0,
"employeesToOnboardOrOffboardCount": 0,
"employeesToOnboardCount": 0,
"employeesToOnboardThisWeekCount": 0,
"employeesToOffboardCount": 0,
"employeesToOffboardThisWeekCount": 0,
"devicesWithMDMOnCount": 0,
"devicesWithMDMOnInAnotherMDMCount": 0,
"devicesWithMDMOffCount": 0,
"devicesWithMissingAgentCount": 0,
"devicesWithReadyZTDCount": 0,
"devicesCompliantCount": 0,
"devicesWithIssuesCount": 0,
"devicesNotEncryptedCount": 0,
"devicesWithoutRecoveryKeyCount": 0,
"devicesWithIcloudLockIssueCount": 0,
"edrEnabled": true,
"devicesWithActiveEDRCount": 0,
"devicesWithEdrNotDetectedCount": 0,
"devicesWithEdrNotDetectedURL": "<string>",
"devicesWithEdrActivationIssueCount": 0,
"devicesWithEdrInactiveCount": 0,
"devicesOnlineCount": 0,
"devicesOfflineCount": 0,
"devicesOffline7dCount": 0
},
"companyMetrics": {
"id": "<string>",
"countConnectedApps": 0,
"countCurrentEmployees": 0,
"deviceMdm": {
"countMdmOn": 0,
"countMdmOff": 0,
"countMdmOnInAnotherMdm": 0,
"countMissingAgent": 0,
"countReadyZTD": 0
},
"deviceEdr": {
"countNotDetected": 0,
"countInstallIncomplete": 0,
"countActivationIssues": 0,
"countOfflineFor7Days": 0,
"countActive": 0
},
"deviceCompliance": {
"countCompliant": 0,
"countIssuesExist": 0,
"countCompliantByAlertCount": 0,
"countIssuesExistByAlertCount": 0
},
"deviceComplianceDetails": {
"countToEncrypt": 0,
"countWithoutRecoveryKey": 0,
"countWithIcloudLockIssue": 0
},
"employeeEnrollment": {
"countToEnroll": 0,
"countEnrolled": 0
},
"deviceAssignment": {
"countInUseAssigned": 0,
"countInUseUnassigned": 0,
"countInStock": 0
},
"deviceOnline": {
"countOnline": 0,
"countOffline": 0,
"countOfflineFor7Days": 0
},
"identitiesAndAccess": {
"countAssignedToEmployee": 0,
"countAssignedToMachine": 0,
"countAssignedToGroup": 0,
"countAssignedToGuest": 0,
"countAssignedToContractor": 0,
"countToLink": 0
}
}
}