#!/usr/bin/env sh set -eu : "${ARTANCLASS_BASE_URL:?Set the ArtanClass HTTPS origin}" : "${ARTANCLASS_API_KEY:?Set the server-side API key}" # Run from this examples directory. Requests below create/sync real data. # 1. Register the class, teacher and FULL student list. Returns only class_url. curl --fail-with-body --max-time 180 --request POST "$ARTANCLASS_BASE_URL/api/v1/lms/classes" \ --header "Authorization: Bearer $ARTANCLASS_API_KEY" \ --header 'Content-Type: application/json' --data-binary @class.json printf '\n' # 2. Get a personal entry link. launch.json contains only external_user_id. # For a student, replace teacher-42 with student-101 in launch.json. curl --fail-with-body --max-time 30 --request POST "$ARTANCLASS_BASE_URL/api/v1/lms/classes/math-701/launch" \ --header "Authorization: Bearer $ARTANCLASS_API_KEY" \ --header 'Content-Type: application/json' --data-binary @launch.json printf '\n' # entry_url is private, single-use and expires after 120 seconds. # In your LMS handler redirect ONLY the authenticated person's browser to it.