CHAPTER 5

Phase 2 - API Interface

RESTful API design specifications for waste tracking, collection management, recycling facility integration, material recovery documentation, and the technical interfaces that enable system interoperability across the e-waste management ecosystem.

From Data to Systems Integration

Phase 1 data formats establish what information should be exchanged. Phase 2 API specifications define how systems exchange this information. Without standardized APIs, organizations must develop custom integrations for each partner, creating exponential complexity as networks grow. A collector working with ten recycling facilities would need ten different integration approaches. Manufacturers tracking products through multiple collection and processing organizations face similar complexity multiplication.

RESTful APIs solve this problem by providing uniform interfaces that all parties implement. Once a system supports the WIA E-Waste Management API, it can integrate with any other compliant system without custom development. This interoperability dramatically reduces integration costs while enabling the networked coordination necessary for effective e-waste management at scale.

REST Architecture Principles

The WIA API follows REST (Representational State Transfer) architectural principles, leveraging HTTP methods and status codes for clear, predictable interactions. RESTful design offers several advantages for e-waste management:

HTTP Methods Semantics

The API employs standard HTTP methods with consistent semantics:

Method Purpose Idempotent Common Use Cases
GET Retrieve resource(s) Yes Get device info, Query collection records
POST Create new resource No Register device, Log collection event
PUT Update/replace resource Yes Update device status, Modify facility info
PATCH Partial update No Add lifecycle event, Update specific fields
DELETE Remove resource Yes Revoke access, Remove test data

Core API Endpoints

The standard defines endpoint categories covering device management, waste tracking, collection operations, processing documentation, material recovery, and compliance reporting. Each category groups related operations under a common path prefix.

Device Management API

Device registration and information retrieval form the foundation of tracking systems. These endpoints allow manufacturers to register products, authorized parties to retrieve information, and systems to update device status throughout the lifecycle.

POST /api/v1/devices
Register new device with manufacturer declaration
Request body: Device object per Phase 1 schema
Response: 201 Created with device_id and QR code URL

GET /api/v1/devices/{device_id}
Retrieve complete device information
Response: 200 OK with full device object including history

GET /api/v1/devices?manufacturer={mfr}&model={model}
Query devices by criteria
Response: 200 OK with array of matching devices

PATCH /api/v1/devices/{device_id}/status
Update device lifecycle status
Request body: {"status": "collected", "timestamp": "..."}
Response: 200 OK with updated device object

GET /api/v1/devices/{device_id}/materials
Retrieve material composition declaration
Response: 200 OK with bill of materials per Phase 1 schema

Collection and Tracking API

Collection events must be logged when devices enter the recycling stream. These endpoints support various collection methods including retail take-back, municipal drop-off, corporate ITAD, and specialized hazardous waste collection.

POST /api/v1/collections
Create new collection event
Request body: {
  "device_ids": ["uuid1", "uuid2", ...],
  "collection_method": "retail_takeback",
  "collector_id": "COL-12345",
  "location": {...},
  "timestamp": "2025-11-08T10:30:00Z",
  "condition_assessments": [...]
}
Response: 201 Created with collection_id

GET /api/v1/collections/{collection_id}
Retrieve collection event details
Response: 200 OK with collection object

GET /api/v1/collections?facility={fac_id}&date_range={range}
Query collections by criteria
Response: 200 OK with array of collections

POST /api/v1/collections/{collection_id}/devices
Add devices to existing collection batch
Request body: {"device_ids": ["uuid3", "uuid4"]}
Response: 200 OK with updated collection

Processing and Recovery API

Processing facilities document each stage of recycling operations. These endpoints record dismantling, shredding, separation, refining, and material recovery activities, creating complete processing audit trails.

POST /api/v1/processing/stages
Document processing stage completion
Request body: {
  "stage_type": "dismantling",
  "input_devices": ["uuid1", "uuid2", ...],
  "facility_id": "RC-US-CA-001",
  "timestamp": "2025-11-10T14:00:00Z",
  "outputs": [
    {
      "component_type": "battery",
      "quantity": 250,
      "total_weight_kg": 3.2,
      "disposition": "battery_recycler"
    }
  ]
}
Response: 201 Created with stage_id

POST /api/v1/recovery/materials
Report material recovery outcomes
Request body: {
  "source_devices": ["uuid1", "uuid2", ...],
  "facility_id": "RC-US-CA-001",
  "recovery_date": "2025-11-15",
  "recovered_materials": [
    {
      "material": "Copper",
      "cas_number": "7440-50-8",
      "weight_kg": 12.5,
      "purity_percentage": 95.2,
      "destination_facility": "SM-US-PA-001"
    }
  ]
}
Response: 201 Created with recovery_report_id

GET /api/v1/recovery/reports/{report_id}
Retrieve recovery report
Response: 200 OK with complete recovery documentation

Authentication and Authorization

E-waste data contains commercially sensitive information, personal data, and compliance documentation requiring access control. The API employs OAuth 2.0 for authentication with role-based access control (RBAC) for authorization.

OAuth 2.0 Implementation

The standard supports multiple OAuth 2.0 flows to accommodate different integration scenarios:

POST /api/v1/oauth/token
Request access token
Request body: {
  "grant_type": "client_credentials",
  "client_id": "recycler_12345",
  "client_secret": "secret_xyz...",
  "scope": "devices:read collections:write"
}
Response: {
  "access_token": "eyJhbG...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "devices:read collections:write"
}

Usage:
GET /api/v1/devices/abc-123
Authorization: Bearer eyJhbG...

Role-Based Access Control

The standard defines stakeholder roles with associated permissions:

Role Permissions Typical Organizations
Manufacturer Register devices, Declare materials, Read own products Electronics manufacturers, OEMs
Collector Create collections, Update device locations, Read devices Retailers, Municipal programs, ITAD
Processor Document processing, Report recovery, Read device materials Recycling facilities, Refiners
Regulator Read all data, Generate reports, Audit compliance EPA, EU authorities, Local agencies
Consumer Track own devices, Verify data wiping Individual device owners

Rate Limiting and Performance

API implementations must handle varying load levels while preventing abuse. The standard specifies rate limiting policies and performance expectations to ensure reliable service.

Rate Limiting Policy

Requests are limited by role and operation type. Limits are communicated via HTTP headers:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 847
X-RateLimit-Reset: 1731072000

HTTP 429 Too Many Requests
Response when limit exceeded:
{
  "error": "rate_limit_exceeded",
  "message": "Rate limit of 1000 requests/hour exceeded",
  "retry_after": 1847
}

Performance Expectations

The standard specifies performance targets for API implementations:

Error Handling and Status Codes

Consistent error responses enable clients to handle failures gracefully. The API uses standard HTTP status codes with structured error bodies providing detailed information.

Status Code Meaning Common Scenarios
200 OK Success GET request successful, Resource updated
201 Created Resource created Device registered, Collection logged
400 Bad Request Invalid request Schema validation failed, Missing required fields
401 Unauthorized Authentication failed Invalid token, Token expired
403 Forbidden Authorization failed Insufficient permissions for operation
404 Not Found Resource doesn't exist Invalid device_id, Collection not found
409 Conflict State conflict Device already registered, Duplicate collection
429 Too Many Requests Rate limit exceeded Too many requests in time window
500 Server Error Server failure Database error, Internal processing failure
HTTP 400 Bad Request
{
  "error": "validation_error",
  "message": "Request body failed schema validation",
  "details": [
    {
      "field": "device.weight_kg",
      "error": "must be positive number",
      "value": -0.5
    },
    {
      "field": "device.weee_category",
      "error": "must be one of WEEE-1 through WEEE-6",
      "value": "WEEE-7"
    }
  ]
}

Versioning Strategy

APIs must evolve while maintaining backward compatibility for existing integrations. The standard employs URL-based versioning with clear deprecation policies.

Version Lifecycle

API versions follow a structured lifecycle:

/api/v1/devices  - Current version (v1.3)
/api/v2/devices  - Future version (in development)

Version information in response headers:
X-API-Version: 1.3.2
X-API-Deprecated: false
X-API-Sunset-Date: null

Webhook Notifications

For real-time integration, the API supports webhooks that notify subscribers of events without polling. Organizations register webhook endpoints to receive notifications about device status changes, collection events, or processing completion.

POST /api/v1/webhooks
Register webhook endpoint
Request body: {
  "url": "https://recycler.example.com/wia-webhook",
  "events": ["device.collected", "processing.complete"],
  "secret": "webhook_secret_xyz"
}
Response: 201 Created with webhook_id

Webhook delivery (sent to registered URL):
POST https://recycler.example.com/wia-webhook
X-WIA-Event: device.collected
X-WIA-Signature: sha256=abc123...
{
  "event_type": "device.collected",
  "event_id": "evt_xyz",
  "timestamp": "2025-11-08T10:30:00Z",
  "data": {
    "device_id": "550e8400-e29b-41d4-a716-446655440000",
    "collection_id": "col_123",
    "collector_id": "COL-12345"
  }
}

Compliance Reporting API

Automated compliance reporting reduces administrative burden while improving data quality. These endpoints generate reports matching various regulatory requirements from standardized tracking data.

GET /api/v1/compliance/reports/epr
Generate Extended Producer Responsibility report
Parameters: 
  - jurisdiction (EU, California, Japan, etc.)
  - time_period (2025-Q1, 2025-annual)
  - format (JSON, PDF, XML)
Response: Jurisdiction-specific EPR report

GET /api/v1/compliance/reports/basel
Generate Basel Convention documentation
Parameters:
  - shipment_id
  - export_country
  - import_country
Response: Prior Informed Consent documentation

GET /api/v1/compliance/certificates/{device_id}
Retrieve recycling certificate for device
Response: PDF certificate with recovery documentation

Chapter Summary

Phase 2 API specifications enable system integration by defining RESTful endpoints for all e-waste management operations. Through standardized authentication, consistent error handling, and clear versioning policies, organizations can build reliable integrations that support coordinated waste management across networks of stakeholders.

Key Takeaways

  • RESTful architecture using standard HTTP methods provides simple, scalable integration that works across platforms and programming languages
  • OAuth 2.0 authentication with role-based access control ensures secure data sharing while protecting commercially sensitive and personal information
  • Comprehensive endpoint coverage spanning device management, collection tracking, processing documentation, and compliance reporting supports complete lifecycle management
  • Structured error responses and standard status codes enable graceful failure handling and debugging across organizational boundaries
  • Webhook notifications and automated compliance reporting reduce polling overhead and administrative burden while enabling real-time coordination

Review Questions

  1. Explain how RESTful APIs reduce integration complexity compared to custom integrations. What specific costs does API standardization eliminate?
  2. Describe the OAuth 2.0 Client Credentials flow. Why is this flow appropriate for server-to-server integration between recyclers and manufacturers?
  3. Compare GET and POST methods semantics. Why is GET required to be idempotent while POST is not? What implications does this have for API design?
  4. How do webhook notifications differ from polling for event updates? What are the advantages and challenges of each approach?
  5. Discuss the API versioning lifecycle. Why is a 2-year support guarantee important for enterprise integrations?
  6. Explain how the compliance reporting API supports multiple jurisdictions with different requirements. What role do API parameters play in this flexibility?

Looking Ahead

With data formats and APIs established, Chapter 6 examines Phase 3: Protocol specifications. These protocols define how e-waste should be physically handled at each processing stage, ensuring safety, maximizing recovery, and maintaining regulatory compliance.

Korea Digital Transformation Detailed Mapping

Korea operates digital transformation through a comprehensive governance system. Digital Government: Digital Platform Government Committee (established September 2022, under the President)·Ministry of the Interior and Safety Digital Government Bureau·e-Government Support Center·Gov.kr·National Citizen Service·KDIS (Korea Digital Information Society)·NIA (National Information Society Agency)·MOIS (Ministry of the Interior and Safety). K-DNS Infrastructure: Korea Internet & Security Agency (KISA) Korea Internet Center·KISA DNS Root Server·KRNIC (Korea Network Information Center)·BGP Korea·National Cyber Security Center (NCSC)·KCC (Korea Communications Commission)·MSIT (Ministry of Science and ICT)·NIA·NIPA. Korean Cloud Infrastructure: KT Cloud·NAVER Cloud (NCloud)·Samsung SDS Cloud·LG U+ Cloud·NHN Cloud·Kakao Enterprise Cloud·SK Telecom Cloud·KISA Cloud Security Assurance Program (CSAP)·KCMVP-validated cloud·ISMS-P (Information Security & Personal Information Management System). Korean Security Certifications: KISA ISMS-P certification·KCMVP (Korean Cryptographic Module Validation Program)·NIS (National Intelligence Service) "National Cryptographic Technology Operation Standards"·NCSC "National Cyber Security Strategy 2024-2028"·CC (Common Criteria) Korean evaluation bodies·EAL4·EAL5·KS X ISO/IEC 15408·19790·24759 Korean Profile. Korean Data Standards: NIA AI Hub·National Data Standardization Committee·Statistics Korea (KOSTAT)·MyData 4 Designated Combination Specialists (Samsung SDS, KICI, KOSTAT, KFTC)·National Institute of Korean Language·National Law Information Center·National Spatial Information Platform·National Spatial Data Center·Korean Spatial Information Standards. Finance and Fintech Standards: FSC (Financial Services Commission)·FSS (Financial Supervisory Service)·FIU (Financial Intelligence Unit)·BOK (Bank of Korea)·FSEC (Financial Security Institute)·KFTC (Korea Financial Telecommunications)·KSD (Korea Securities Depository)·KRX (Korea Exchange) 8-agency cooperation. 5G/6G Communications Infrastructure: 5G subscribers 35 million (2024)·5G base stations 350,000·6G commercialization target 2028·5G dedicated networks 16 operators·6G Acceleration Council (MSIT, 2024). K-Content: KOCCA (Korea Creative Content Agency)·MCST (Ministry of Culture, Sports and Tourism)·KCA (Korea Communications Agency)·Korea Culture Information Service Agency·Korean Film Archive·Korea Publishing Industry Promotion Agency. Data 3 Acts (Personal Information Protection Act·Credit Information Act·Telecommunications Network Act, 2020 enforcement)·Data Industry Act (2021)·Public Data Act (2013)·AI Framework Act (2026)·Digital Platform Government Framework Act (2024 proposed) — Korea digital transformation core legislation.

Korea Industrial, Research, Education Infrastructure Mapping

Korea operates its industrial ecosystem and standardization system through the following core infrastructure. Korea Top 5 Groups: Samsung, Hyundai Motor, LG, SK, Lotte. Each group operates standardization committees and ISO/IEC TC Korean secretariats. Samsung Electronics (semiconductors, displays, home appliances, telecom)·Hyundai Motor (automobiles, mobility)·LG Electronics (home appliances, displays, OLED)·SK hynix (memory)·LG Energy Solution·Samsung SDI (batteries)·POSCO Future M (materials)·Hyundai Mobis (parts). Korean IT Big Tech: NAVER (search, cloud, AI HyperCLOVA)·Kakao (messenger, payment, mobility, banking)·Coupang (e-commerce, logistics)·Karrot Market·Toss·Woowa Brothers. Korea Telcos: SK Telecom·KT·LG U+. 5G·5G dedicated networks·B2B cloud·AI businesses operating. Korea Top 7 Research Universities: Seoul National University·KAIST·POSTECH·Yonsei University·Korea University·UNIST·DGIST·GIST. All serve as standardization R&D bases and ISO/IEC/IEEE Korean chairs. Korea Government-affiliated National Research Institutes (26): KIST, KAERI, KIMM, KIER, KFRI, KRICT, KRIBB, KARI, KASI, KIGAM, KICT, KISTI, KETI, ETRI, NIMS, KIMS, KISDI, KOTRA, STEPI, KOEN, KICCE, KIET, KIPF, KIHASA, KICJ, KLRI. Korea Industrial Complexes / Tech Valleys: Pangyo Techno Valley·Dongtan·Gwanggyo·Songdo IBD·Yeouido·Gangnam·Sihwa·Banwol·Gumi·Ulsan·Changwon·Geoje·Yeosu·Onsan·Cheongju·Iksan·Gwangyang·POSCO Gwangyang Steel Mill·Asan Bay·Seosan·Songdo·Incheon Airport·Sejong·Cheongna·Geomdan. Korea Trade and Finance Infrastructure: Korea International Trade Association (KITA)·Korea Trade-Investment Promotion Agency (KOTRA)·Export-Import Bank of Korea (KEXIM)·Bank of Korea·Kookmin Bank·Shinhan·Hana·Woori·NH Nonghyup·IBK Industrial Bank·SC First Bank·Citi Bank Korea·HSBC Korea·DBS Korea — 14 Korean major banks and foreign banks. Korea K-POP / K-Content: HYBE·SM·YG·JYP 4 major entertainment companies·CJ ENM·tvN·MBC·KBS·SBS·EBS·YTN·Yonhap News TV·JTBC Korean broadcasting·NETFLIX Korea·Disney Plus·TVING·Wavve·Watcha·Coupang Play. Korea Gaming Industry: Nexon·NCsoft·Krafton·Netmarble·Kakao Games·Pearl Abyss·Com2uS·Gamevil·NHN·Smilegate·Webzen. Korea Automotive / Battery: Hyundai Motor·Kia·Genesis·LG Energy Solution·Samsung SDI·SK On·POSCO Future M·EcoPro·L&F battery cathode material suppliers. Korea Semiconductor: Samsung Electronics (HBM3E·HBM4)·SK hynix (HBM3E 12-Hi)·DB HiTek·SK siltron·SK Enpulse·Dongjin Semichem·Seoul Semiconductor·Simmtech·Samsung Display·LG Display.

Korea Industrial Cluster, National Strategic Technologies, Workforce Development

Korea operates a comprehensive industrial cluster system. Korea Top 12 National Strategic Technologies (5th Science and Technology Master Plan 2023-2027): (1) Semiconductors and Displays (2) Secondary Batteries (3) Advanced Mobility (autonomous driving, UAM) (4) Next-Generation Nuclear (SMR) (5) Advanced Bio (6) Aerospace and Marine (7) Hydrogen (8) Cybersecurity (9) Artificial Intelligence (10) Next-Generation Communications (11) Advanced Robotics and Manufacturing (12) Quantum. 12 fields receive direct investment of 5 trillion KRW annually, cumulative 30 trillion KRW by 2030. Korea Major Industrial Clusters: Pangyo IT Cluster (1,300+ companies, 100 trillion KRW revenue), Gangnam Fintech (200+ companies), Songdo BT Bio Cluster, Daegu Medical Cluster, Ulsan Industry (shipbuilding, petrochemicals, automotive), Changwon Machinery, Changwon National Industrial Complex, Siheung and Banwol (SME manufacturing), Yeosu Petrochemicals, Pyeongtaek Semiconductor (Samsung Electronics Pyeongtaek Campus), Icheon and Cheongju Semiconductor (SK hynix Icheon and Cheongju Campuses), Asan Display (Samsung Display Asan Campus), Gumi Mobile (Samsung Gumi Campus), Pohang Steel (POSCO Pohang Steel Mill), Gwangyang Steel (POSCO Gwangyang Steel Mill), Dangjin Steel (Hyundai Steel Dangjin), Ulsan Automotive (Hyundai Motor Ulsan Plant), Asan Automotive (Hyundai Asan Plant), Kia Gwangju and Sohari, POSCO Gwangyang and Pohang Steel Mills, SK hynix Icheon and Cheongju, Samsung Electronics Hwaseong, Giheung, Pyeongtaek, Onyang, Cheonan, Asan Semiconductor Facilities. Major Industrial Complexes and Techno Valleys: Pangyo Techno Valley (1st 800 companies, 2nd 600 companies, 3rd 1,200 companies), Dongtan Techno Valley, Gwanggyo Techno Valley, Songdo IBD, Yeouido Financial District, Gangnam Teheran-ro Valley, Sihwa, Banwol, Gumi, Ulsan, Changwon, Geoje, Yeosu, Ulsan Mipo, Onsan, Cheongju, Iksan, Gwangyang, Yeosu, POSCO Gwangyang Steel Mill, Asan Bay, Seosan, Songdo, Incheon Airport, Sejong, Cheongna, Geomdan, Pyeongtaek Automotive Industrial Complex, Giheung Semiconductor Complex, Icheon Semiconductor Complex, Asan Display Complex, Gumi Mobile Complex, Changwon National Industrial Complex, Ulsan Mipo National Industrial Complex, Yeosu National Industrial Complex, Onsan National Industrial Complex. Korea Workforce Statistics: STEM undergraduate students 700,000 (26% of all university students), STEM graduate students 170,000, PhD researchers 140,000, STEM doctorates conferred 8,000 annually (Seoul National University 1,200, KAIST 800, POSTECH 400, Yonsei University 700, Korea University 600, UNIST 250, DGIST 100, GIST 200, KISTI 50, KIST and ETRI postdoctoral programs 1,000), information security experts 300,000 (KISA-trained and private), AI experts 50,000 (NIA, IITP, NIPA, Samsung, LG, SK, NAVER, Kakao trained), semiconductor experts 260,000 (Samsung Electronics 60,000, SK hynix 30,000, DB HiTek, SK siltron). National R&D Project Operation: National R&D projects 100,000+ annually (MSIT 35,000, MOTIE 25,000, MSS 20,000, MOE 15,000, others 5,000), R&D participating institutions 25,000+, R&D participating researchers 530,000, National R&D output (papers, patents) 540,000 annually. Korea Corporate R&D Investment Top 10 (2024): Samsung Electronics 28 trillion KRW, LG Electronics 9 trillion KRW, SK hynix 8 trillion KRW, Hyundai Motor 6 trillion KRW, Kia 4 trillion KRW, LG Chem 3.5 trillion KRW, LG Display 3.2 trillion KRW, POSCO 3 trillion KRW, Samsung SDI 2.7 trillion KRW, SK Innovation 2.5 trillion KRW.