# Worked Example: Roster And Grade Evidence Report

Goal: produce a short SIS-style report proving that a class, student, enrollment, assignment, result, grading period, and export package are reachable through the live OneRoster surface.

Do not use local data files. Do not sort or infer from collection position. Use direct detail and sub-collection calls, then summarize what the surface returns.

## 1. Prepare The Demo Token

```bash
export ONEROSTER_BASE_URL="https://platform3-andymontgomery-9773s-projects.vercel.app/oneroster/1edtech/implementation/api"
export BASE_URL="$ONEROSTER_BASE_URL"
export ONEROSTER_DEMO_JWT="$(curl -fsS -X POST "$BASE_URL/dev/mint?tenantId=demo" | jq -r '.token')"
export TOKEN="$ONEROSTER_DEMO_JWT"
```

If `jq` is unavailable, copy the `token` value returned by the mint call and assign it to `ONEROSTER_DEMO_JWT` and `TOKEN`.

## 2. Fetch The Evidence Graph

```bash
curl -fsS "$BASE_URL/orgs/school-north-valley" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/classes/class-algebra-1-a" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/users/student-maya-johnson" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/enrollments/enrollment-maya-algebra-1-a" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/lineItems/lineitem-algebra-quiz-1" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/classes/class-algebra-1-a/students" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/classes/class-algebra-1-a/lineItems" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/users/student-maya-johnson/enrollments" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/users/student-maya-johnson/results" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/results/result-maya-algebra-quiz-1" \
  -H "Authorization: Bearer $TOKEN"

curl -fsS "$BASE_URL/gradingPeriods/grading-period-q1-2026" \
  -H "Authorization: Bearer $TOKEN"
```

Observed live proof from 2026-06-10T21:15:51Z:

- `orgs/school-north-valley` returned `North Valley High School`.
- `classes/class-algebra-1-a` returned `Algebra I - Section A`.
- `users/student-maya-johnson` returned username `maya.johnson`.
- `enrollments/enrollment-maya-algebra-1-a` linked `student-maya-johnson` to `class-algebra-1-a` with role `student`.
- `lineItems/lineitem-algebra-quiz-1` returned `Algebra Quiz 1`.
- `results/result-maya-algebra-quiz-1` returned score `92` for the class result.
- `gradingPeriods/grading-period-q1-2026` returned `Quarter 1 Grading Period`.

The demo tenant is writable and may contain previous probe rows. Do not assert that any seed row is first in a collection. Use the direct IDs above or follow links returned by sub-collections.

## 3. Export A Package

```bash
curl -fsS -X POST "$BASE_URL/exports/csv" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: skill-pack-export-$(date +%s)" \
  -d '{"mode":"bulk"}'
```

Expected shape:

- `batch.direction` is `export`.
- `batch.batch_id` starts with `orbatch_`.
- `package.files` includes `manifest.csv`.
- The current OneRoster export returns 22 package files.

## 4. Write The Report

A correct report can say:

> The demo tenant exposes North Valley High School, Algebra I - Section A, student Maya Johnson, Maya's class enrollment, the Algebra Quiz 1 line item, Maya's quiz result with score 92, and Quarter 1 Grading Period. The same surface exported a OneRoster bulk package with a batch id beginning `orbatch_` and a `manifest.csv` file.

Also include:

- the `BASE_URL`;
- the call list you ran;
- whether you used demo or real-tenant credentials;
- links to the customer website and data dictionary;
- any Problem JSON returned by the surface, preserving `code`, `type`, `requestId`, and `traceId`.

Do not include JWTs in the report.
