Python server integration
Install
Python 3.9+. Save as classroom.py, configure the environment and run python3 classroom.py.
python3 -m pip install eduskit==0.1.5
HTTP uses standard-library urllib and synchronous calls. In an async web service, use a worker thread or task to avoid blocking its event loop. Configuration uses snake_case; API fields remain camelCase.
Create a classroom and issue a student credential
Set the backend environment variables. This example uses separate teacher and student accounts. Replace the example avatar URLs with accessible resources. Each run creates a new classroom; originId only makes user registration idempotent.
import os
from datetime import datetime, timedelta, timezone
from eduskit import Eduskit, EduskitError
def required(name):
value = os.environ.get(name, '').strip()
if not value:
raise ValueError(f'Missing {name}')
return value
def create_demo_classroom():
sdk = Eduskit(
timeout_ms=10_000,
client={
'base_url': required('EDU_SERVER_URL'),
'app_id': required('EDU_APP_ID'),
'app_key': required('EDU_APP_KEY'),
'app_secret': required('EDU_APP_SECRET'),
},
)
teacher = sdk.client.users.register(
originId='demo-teacher-001', nickname='Teacher',
avatar='https://example.com/teacher.png',
)
student = sdk.client.users.register(
originId='demo-student-001', nickname='Student',
avatar='https://example.com/student.png',
)
starts_at = datetime.now(timezone.utc) + timedelta(minutes=15)
classroom = sdk.client.classrooms.create(
name='SDK integration',
startsAt=starts_at.isoformat(timespec='milliseconds').replace('+00:00', 'Z'),
durationMinutes=60,
teacherEduUserId=teacher['eduUserId'],
studentEduUserIds=[student['eduUserId']],
joinPolicy='invite_only',
)
token = sdk.client.auth.issue_token(
eduUserId=student['eduUserId'], originId=student['originId'], expiresIn=3600,
)
return {
'appId': token['appId'],
'classroomId': classroom['classroomId'],
'userId': student['eduUserId'],
'userToken': token['accessToken'],
'expiresAt': token['expiresAt'],
}
if __name__ == '__main__':
try:
entry = create_demo_classroom()
print({'classroomId': entry['classroomId'], 'userId': entry['userId']})
except EduskitError as error:
print(error.error_code, error.status, error.trace_id, error.source)
raise SystemExit(1)
Return userToken through your entry endpoint to the authenticated student. In production, create classrooms during scheduling and issue tokens when users enter.
Calling conventions
sdk.client / sdk.whiteboard_client; methods include issue_token, replace_students and get_ui_config. Configure the request timeout with timeout_ms.
See Classroom API for members, permissions, courseware and start/end methods. See Whiteboard server integration for recordings and conversion, and Errors and troubleshooting for failure and retry behavior.
Application and tenant APIs
Source builds provide 50 application-authenticated HTTP routes through client, including users, classrooms, courseware libraries, live assets, and diagnostics. See application business APIs and workflow examples. The separate tenant management client uses tenant sessions for account, application, dashboard, and billing operations. The new methods require the matching server-api deployment and a source build; public 0.1.5 packages do not include them.