Chapter 27: Integration with External Systems
Strategies for data exchange between Guardian and external platforms
This chapter demonstrates two critical integration patterns for connecting Guardian policies with external environmental registry systems. You'll learn how to transform Guardian data for external platforms like Verra Project Hub and how to receive MRV data from external devices and systems.
Integration Architecture Overview
Guardian's policy workflow engine supports bidirectional integration with external systems through specialized workflow blocks and API endpoints. This enables Guardian to function as both a data provider and consumer in complex environmental certification ecosystems.
Two Primary Integration Patterns:
Data Transformation for External Systems: Converting Guardian project data to external system formats
External Data Reception: Accepting monitoring data from external devices and aggregating systems
Use Case 1: Transforming Data for External Systems
Introduction to dataTransformationAddon
Guardian's dataTransformationAddon block enables transformation of Guardian project data into formats required by external registry systems. This block executes JavaScript transformation code that converts Guardian document structures into external API formats.
Primary Applications:
Submitting project data to Verra Project Hub
Integrating with Gold Standard registry systems
Preparing data for CDM project submissions
Custom registry platform integration
VM0033 DataTransformation Implementation
The VM0033 policy demonstrates production-grade data transformation in the project-description block:

Transformation Code Structure
The dataTransformationAddon block executes JavaScript code that transforms Guardian documents into any format needed. Here's the core transformation pattern from VM0033:
Data Transformation Best Practices
1. Field Mapping Strategy
2. Data Type Conversions
3. Complex Object Transformations
Use Case 2: Receiving Data from External Systems
External Data Reception Architecture
Guardian's externalDataBlock enables reception of monitoring data from external devices, IoT sensors, and third-party MRV systems. This pattern can be used for automated monitoring reports and real-time project tracking. It is the approaches used in Gold standard's metered energy cooking policy implemented on Guardian.

External Data Flow:
Project validation triggers MRV configuration generation. Download config button binds to validated projects.
Download MRV configuration file
External devices/servers use the config to prepare a VC and send data to
/externalendpointexternalDataBlockprocesses and validates incoming dataData aggregates into monitoring reports with a frequency set in the timer block.
MRV Configuration Download Pattern
Guardian implements a download-based pattern for external data integration. When a project is validated, a comprehensive MRV configuration file becomes available for download:
External Data Submission Endpoint
Guardian exposes an /external endpoint for receiving data from external systems:
Endpoint Structure:
Authentication:
Data Payload Format:
ExternalDataBlock Implementation
The externalDataBlock handles incoming external data with validation and processing:
MRV Sender Integration
Guardian includes an MRV sender tool that simulates external data submission. The source code is available here - https://github.com/hashgraph/guardian/tree/main/mrv-sender
Key Configuration Elements:
URL: External endpoint (
https://guardianservice.app/api/v1/external)Hedera Integration: Account ID and private key for blockchain transactions
Schema Context: Complete JSON-LD schema definition with field types
DID Documents: Verification methods and authentication keys
Policy References: Policy ID, tag, and document reference for linking
Data Generation Options:
Values Mode: Use specific values for each field
Templates Mode: Use predefined data templates
Random Mode: Generate random values within specified ranges
Chapter Summary
This chapter demonstrated Guardian's bidirectional integration capabilities through two essential patterns:
Data Transformation for External Systems using dataTransformationAddon blocks enables Guardian to export project data in formats required by external registries. The VM0033 implementation shows production-grade JavaScript transformation code that converts Guardian documents into external system formats.
External Data Reception using externalDataBlock and MRV configurations enables automated monitoring data collection from external devices and systems. The metered energy policy pattern demonstrates how projects generate downloadable MRV configuration files that external systems use to submit data back to Guardian.
Key Implementation Elements:
JavaScript-based data transformation within Guardian policy blocks
Comprehensive MRV configuration files with schema definitions and DID documents
Hedera blockchain integration for secure data transactions
Schema validation and document verification for incoming data
Timer-based aggregation for monitoring report generation
These integration patterns enable Guardian to function as a comprehensive platform in environmental certification ecosystems, supporting both automated data collection and seamless registry integration.
Next Steps: Chapter 28 will explore advanced Guardian features including multi-methodology support, AI-powered search capabilities, and future platform developments.
Artifacts and References
Related Documentation
Code Examples
dataTransformationAddon Configuration
External Data Submission Format
MRV Configuration Structure
Last updated