📚 제5장: Phase 2 - API 인터페이스 표준

이 장에서는 WIA EDU 표준의 RESTful API를 정의합니다. 이러한 API는 교육 플랫폼 간의 원활한 통합을 가능하게 합니다.


5.1 API 설계 원칙

5.1.1 RESTful 아키텍처

WIA EDU API는 REST 원칙을 따릅니다:

5.1.2 기본 URL 구조

기본 URL: https://api.wiastandards.com/edu/v1

리소스 패턴:
  /profiles                    학습자 프로필
  /profiles/{id}               특정 프로필
  /courses                     과정
  /courses/{id}                특정 과정
  /courses/{id}/content        과정 콘텐츠
  /assessments                 평가
  /assessments/{id}            특정 평가
  /match                       프로필 매칭

5.2 학습자 프로필 API

5.2.1 프로필 생성

POST /profiles
Content-Type: application/json
Authorization: Bearer {token}

요청 본문:
{
  "learner_info": {
    "name": "김민수",
    "institution_id": "UNIV-KR-001"
  },
  "display_preferences": {
    "screen_reader": {
      "enabled": true,
      "reader": "nvda",
      "rate": "medium"
    },
    "text_settings": {
      "font_size": "large",
      "dyslexia_font": false
    }
  },
  "content_preferences": {
    "captions": true,
    "transcripts": true,
    "sign_language": "ksl"
  }
}

응답 (201 Created):
{
  "profile_id": "EDU-2025-AB12-CD34",
  "schema_version": "1.0.0",
  "created_at": "2025-01-15T09:00:00Z",
  "links": {
    "self": "/profiles/EDU-2025-AB12-CD34",
    "export": "/profiles/EDU-2025-AB12-CD34/export"
  }
}

5.2.2 프로필 조회

GET /profiles/{profile_id}
Authorization: Bearer {token}

응답 (200 OK):
{
  "profile_id": "EDU-2025-AB12-CD34",
  "schema_version": "1.0.0",
  "learner_info": { ... },
  "display_preferences": { ... },
  "control_preferences": { ... },
  "content_preferences": { ... },
  "wia_integrations": {
    "aac_profile_id": "AAC-2025-EF56-GH78",
    "sync_enabled": true
  }
}

5.2.3 프로필 업데이트

PATCH /profiles/{profile_id}
Content-Type: application/json
Authorization: Bearer {token}

요청 본문:
{
  "display_preferences": {
    "text_settings": {
      "font_size": "x-large"
    }
  }
}

응답 (200 OK):
{
  "profile_id": "EDU-2025-AB12-CD34",
  "updated_at": "2025-01-15T10:30:00Z",
  "changes": ["display_preferences.text_settings.font_size"]
}

5.3 프로필 매칭 API

5.3.1 과정 매칭

POST /match/course
Content-Type: application/json
Authorization: Bearer {token}

요청 본문:
{
  "profile_id": "EDU-2025-AB12-CD34",
  "course_id": "COURSE-2025-001"
}

응답 (200 OK):
{
  "match_result": {
    "compatibility_score": 0.92,
    "matched_accommodations": [
      {
        "need": "screen_reader",
        "available": true,
        "details": "NVDA 및 JAWS 호환"
      },
      {
        "need": "captions",
        "available": true,
        "details": "모든 비디오에 한국어 자막 제공"
      },
      {
        "need": "sign_language",
        "available": true,
        "details": "KSL 통역 영상 제공"
      }
    ],
    "gaps": [
      {
        "need": "braille",
        "available": false,
        "alternative": "스크린 리더용 텍스트 제공"
      }
    ],
    "recommended_settings": {
      "auto_apply": true,
      "settings": {
        "captions_enabled": true,
        "caption_language": "ko",
        "screen_reader_mode": true
      }
    }
  }
}

5.3.2 콘텐츠 매칭

POST /match/content
Content-Type: application/json

요청 본문:
{
  "profile_id": "EDU-2025-AB12-CD34",
  "content_ids": ["CONTENT-001", "CONTENT-002", "CONTENT-003"]
}

응답 (200 OK):
{
  "matches": [
    {
      "content_id": "CONTENT-001",
      "accessible": true,
      "access_modes_available": ["auditory", "textual"],
      "recommended_alternative": null
    },
    {
      "content_id": "CONTENT-002",
      "accessible": false,
      "access_modes_available": ["visual"],
      "recommended_alternative": {
        "content_id": "CONTENT-002-ALT",
        "type": "audio_description"
      }
    }
  ]
}

5.4 과정 API

5.4.1 과정 접근성 정보 조회

GET /courses/{course_id}/accessibility
Authorization: Bearer {token}

응답 (200 OK):
{
  "course_id": "COURSE-2025-001",
  "accessibility_statement": {
    "commitment": "모든 학습자를 위한 접근성 보장",
    "wcag_conformance": "AA",
    "last_audit": "2025-01-01"
  },
  "accommodations_available": {
    "timing": {
      "extended_time": true,
      "flexible_deadlines": true
    },
    "format": {
      "captions": true,
      "transcripts": true,
      "sign_language": true,
      "audio_description": true
    },
    "input": {
      "keyboard_navigation": true,
      "voice_control": true,
      "switch_access": true
    }
  },
  "content_summary": {
    "total_items": 45,
    "fully_accessible": 42,
    "partial_accessible": 3,
    "accessibility_score": 0.93
  }
}

5.4.2 과정 콘텐츠 목록

GET /courses/{course_id}/content?accessible_for={profile_id}
Authorization: Bearer {token}

응답 (200 OK):
{
  "course_id": "COURSE-2025-001",
  "content_items": [
    {
      "content_id": "CONTENT-001",
      "title": "강의 1: HTML 소개",
      "type": "video",
      "duration_minutes": 45,
      "accessibility": {
        "compatible": true,
        "features": ["captions", "transcript", "audio_description"],
        "personalized_url": "/content/CONTENT-001?profile=EDU-2025-AB12-CD34"
      }
    }
  ],
  "pagination": {
    "total": 45,
    "page": 1,
    "per_page": 20
  }
}

5.5 평가 API

5.5.1 편의제공이 적용된 평가 시작

POST /assessments/{assessment_id}/sessions
Content-Type: application/json
Authorization: Bearer {token}

요청 본문:
{
  "profile_id": "EDU-2025-AB12-CD34",
  "accommodations_requested": [
    "extended_time",
    "screen_reader",
    "breaks"
  ]
}

응답 (201 Created):
{
  "session_id": "SESSION-2025-XY12",
  "assessment_id": "ASSESS-001",
  "accommodations_applied": {
    "timing": {
      "base_time_minutes": 60,
      "extended_time_minutes": 90,
      "multiplier": 1.5,
      "breaks_allowed": true,
      "break_duration_minutes": 10
    },
    "presentation": {
      "screen_reader_mode": true,
      "high_contrast": true,
      "font_size": "large"
    },
    "response": {
      "keyboard_only": true,
      "spell_check": true
    }
  },
  "start_url": "/assessments/ASSESS-001/sessions/SESSION-2025-XY12/start",
  "expires_at": "2025-01-15T12:00:00Z"
}

5.6 오류 처리

5.6.1 표준 오류 응답

오류 응답 형식:
{
  "error": {
    "code": "PROFILE_NOT_FOUND",
    "message": "요청한 프로필을 찾을 수 없습니다",
    "details": {
      "profile_id": "EDU-2025-INVALID"
    },
    "documentation": "https://wiastandards.com/docs/errors/PROFILE_NOT_FOUND"
  }
}

HTTP 상태 코드:
  400 Bad Request       잘못된 요청 형식
  401 Unauthorized      인증 필요
  403 Forbidden         권한 부족
  404 Not Found         리소스를 찾을 수 없음
  409 Conflict          리소스 충돌
  422 Unprocessable     유효성 검사 실패
  429 Too Many Requests 요청 제한 초과
  500 Internal Error    서버 오류

5.7 장 요약

핵심 내용:

  1. RESTful 설계: 리소스 중심, 무상태, 캐시 가능한 API
  2. 프로필 API: CRUD 작업 및 프로필 이식성
  3. 매칭 API: 학습자 요구와 과정/콘텐츠 기능 자동 매칭
  4. 평가 API: 편의제공이 자동 적용된 평가 세션
  5. 오류 처리: 일관된 오류 응답 형식 및 문서화