curl --request GET \
--url https://{host}/primula/api/v3/enrollments \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/primula/api/v3/enrollments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/primula/api/v3/enrollments', 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://{host}/primula/api/v3/enrollments",
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://{host}/primula/api/v3/enrollments"
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://{host}/primula/api/v3/enrollments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/primula/api/v3/enrollments")
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[
{
"period": "<string>",
"as_of_date": "<string>",
"total_enrollment": 123
}
]List enrollment series
Scoped to company_id; the handler does not restrict this read to the session school assignments. The response representation is selected in this order:
| Selection | Response | Date selectors |
|---|---|---|
| view=trend | EnrollmentTrend array | Optional period_from/period_to |
| group_by=period (unless trend) | EnrollmentPeriodAnalytics array | year_from/year_to |
| view=analytics, group_by=month | EnrollmentAnalytics array | period_from/period_to |
| Default: view=basic, group_by=month | EnrollmentMonthly array | period_from/period_to |
Monthly basic/analytics default to 2023-01 through the current month. Period analytics defaults to 2023 through the current year. Trend uses the available calculated periods when bounds are omitted. No pagination is implemented. Each representation returns its row count in X-Total-Count. For view=trend, omit both range bounds or provide both; endpoints must lie within the available horizon. Incomplete, invalid, inverted or out-of-horizon trend ranges fail in the data layer and currently return HTTP 500.
curl --request GET \
--url https://{host}/primula/api/v3/enrollments \
--header 'Authorization: Bearer <token>'import requests
url = "https://{host}/primula/api/v3/enrollments"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/primula/api/v3/enrollments', 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://{host}/primula/api/v3/enrollments",
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://{host}/primula/api/v3/enrollments"
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://{host}/primula/api/v3/enrollments")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/primula/api/v3/enrollments")
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[
{
"period": "<string>",
"as_of_date": "<string>",
"total_enrollment": 123
}
]Authorizations
Access token issued by POST /sessions and associated with a valid server-side session.
Query Parameters
Company UUID. Must equal the authenticated session company when that session has a company assigned; the equality check is skipped for sessions without one.
School UUID.
Select the representation.
basic, analytics, trend period implies period analytics unless view=trend.
month, period First monthly period for monthly or trend views.
^\d{4}-(0[1-9]|1[0-2])$Last monthly period for monthly or trend views.
^\d{4}-(0[1-9]|1[0-2])$First year for group_by=period; defaults to 2023.
^\d{4}$Last year for group_by=period; defaults to the current year.
^\d{4}$