DEV Community

Ahmed Moussa
Ahmed Moussa

Posted on • Originally published at api.aaido.dev

PipelineAPI Tutorial: Automated Data Transformation for Developers

PipelineAPI is a data transformation service that handles ETL (Extract, Transform, Load) operations, data conversion, and enrichment through a simple REST API. This tutorial covers the core functionality, practical implementation patterns, and integration strategies for development teams.

What is PipelineAPI?

PipelineAPI processes structured and semi-structured data through configurable transformation pipelines. The service accepts data in various formats (JSON, CSV, XML), applies transformation rules, enrichment operations, and outputs clean, standardized data ready for your applications.

Key capabilities include:

  • Format conversion between JSON, CSV, XML, and other structured formats
  • Data validation and cleansing
  • Field mapping and transformation
  • Data enrichment from external sources
  • Batch and real-time processing modes

Getting Started

First, create an account and obtain API credentials:

curl -X POST https://api.aaido.dev/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "your-email@company.com",
    "organization": "Your Company"
  }'
Enter fullscreen mode Exit fullscreen mode

The signup response includes your API key:

{
  "status": "success",
  "api_key": "pk_live_abc123...",
  "message": "Account created successfully"
}
Enter fullscreen mode Exit fullscreen mode

Basic Pipeline Operations

Creating a Data Pipeline

Define a transformation pipeline by specifying input format, transformation rules, and output requirements:

curl -X POST https://api.aaido.dev/v1/products/pipeline \
  -H "Authorization: Bearer pk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "user-data-transform",
    "input_format": "json",
    "output_format": "json",
    "transformations": [
      {
        "type": "field_mapping",
        "rules": {
          "firstName": "first_name",
          "lastName": "last_name",
          "emailAddress": "email"
        }
      },
      {
        "type": "validation",
        "rules": {
          "email": {"pattern": "^[\\w\\.-]+@[\\w\\.-]+\\.[a-zA-Z]{2,}$"},
          "first_name": {"required": true, "min_length": 1}
        }
      }
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

Response includes pipeline configuration and execution endpoint:

{
  "pipeline_id": "pipe_xyz789",
  "status": "active",
  "execution_url": "/v1/products/pipeline/pipe_xyz789/execute",
  "created_at": "2024-01-15T10:30:00Z"
}
Enter fullscreen mode Exit fullscreen mode

Executing Pipeline Transformations

Process data through your configured pipeline:

curl -X POST https://api.aaido.dev/v1/products/pipeline/pipe_xyz789/execute \
  -H "Authorization: Bearer pk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "data": [
      {
        "firstName": "John",
        "lastName": "Smith",
        "emailAddress": "john.smith@company.com"
      },
      {
        "firstName": "Jane",
        "lastName": "Doe",
        "emailAddress": "jane.doe@company.com"
      }
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

The API returns transformed data with processing metadata:

{
  "status": "completed",
  "processed_records": 2,
  "valid_records": 2,
  "errors": [],
  "data": [
    {
      "first_name": "John",
      "last_name": "Smith",
      "email": "john.smith@company.com"
    },
    {
      "first_name": "Jane",
      "last_name": "Doe", 
      "email": "jane.doe@company.com"
    }
  ],
  "execution_time_ms": 245
}
Enter fullscreen mode Exit fullscreen mode

Practical Use Cases

1. Customer Data Standardization

E-commerce applications often receive customer data from multiple sources with inconsistent formats. This pipeline normalizes address data and validates phone numbers:

curl -X POST https://api.aaido.dev/v1/products/pipeline \
  -H "Authorization: Bearer pk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "customer-address-normalization",
    "transformations": [
      {
        "type": "address_standardization",
        "rules": {
          "country_codes": "iso_alpha2",
          "postal_format": "standardize"
        }
      },
      {
        "type": "phone_validation",
        "rules": {
          "format": "e164",
          "country_default": "US"
        }
      }
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

2. CSV to JSON API Integration

Legacy systems often export CSV files that need conversion for modern API consumption:

curl -X POST https://api.aaido.dev/v1/products/pipeline \
  -H "Authorization: Bearer pk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "csv-to-api-format",
    "input_format": "csv",
    "output_format": "json",
    "transformations": [
      {
        "type": "header_mapping",
        "rules": {
          "Product ID": "product_id",
          "Product Name": "name",
          "Unit Price": "price"
        }
      },
      {
        "type": "data_types",
        "rules": {
          "price": "decimal",
          "product_id": "integer"
        }
      }
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

3. Real-time Data Enrichment

Enhance incoming webhook data with additional context from external APIs:

curl -X POST https://api.aaido.dev/v1/products/pipeline \
  -H "Authorization: Bearer pk_live_abc123..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "webhook-enrichment",
    "transformations": [
      {
        "type": "ip_geolocation",
        "source_field": "client_ip",
        "target_fields": ["country", "city", "timezone"]
      },
      {
        "type": "user_agent_parsing",
        "source_field": "user_agent",
        "target_fields": ["browser", "os", "device_type"]
      }
    ]
  }'
Enter fullscreen mode Exit fullscreen mode

CI/CD Integration

Integrate PipelineAPI into your deployment workflow to ensure data consistency across environments. This GitHub Actions example validates data transformations during deployment:

name: Data Pipeline Validation
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  validate-data-pipeline:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Test Data Transformations
        run: |
          # Execute pipeline with test dataset
          RESPONSE=$(curl -s -X POST \
            https://api.aaido.dev/v1/products/pipeline/${{ secrets.PIPELINE_ID }}/execute \
            -H "Authorization: Bearer ${{ secrets.PIPELINEAPI_KEY }}" \
            -H "Content-Type: application/json" \
            -d @test-data/sample-input.json)

          # Validate response
          ERROR_COUNT=$(echo $RESPONSE | jq '.errors | length')
          if [ "$ERROR_COUNT" -gt 0 ]; then
            echo "Pipeline validation failed with $ERROR_COUNT errors"
            echo $RESPONSE | jq '.errors'
            exit 1
          fi

          echo "Pipeline validation successful"

      - name: Update Production Pipeline
        if: github.ref == 'refs/heads/main'
        run: |
          curl -X PUT \
            https://api.aaido.dev/v1/products/pipeline/${{ secrets.PROD_PIPELINE_ID }} \
            -H "Authorization: Bearer ${{ secrets.PIPELINEAPI_KEY }}" \
            -H "Content-Type: application/json" \
            -d @config/production-pipeline.json
Enter fullscreen mode Exit fullscreen mode

Error Handling and Monitoring

PipelineAPI provides detailed error information for debugging transformation issues:

{
  "status": "completed_with_errors",
  "processed_records": 100,
  "valid_records": 95,
  "errors": [
    {
      "record_index": 23,
      "field": "email",
      "error": "Invalid email format",
      "value": "invalid-email"
    }
  ],
  "data": [...],
  "execution_time_ms": 1250
}
Enter fullscreen mode Exit fullscreen mode

Monitor pipeline performance by tracking execution times and error rates. Set up alerts for pipelines that exceed expected processing times or error thresholds.

Best Practices

  • Validate transformations with sample data before production deployment
  • Version your pipeline configurations alongside application code
  • Implement retry logic for transient API failures
  • Monitor processing metrics to identify performance bottlenecks
  • Use batch processing for large datasets to optimize throughput

PipelineAPI simplifies data transformation workflows by providing reliable, scalable ETL operations through a developer-friendly REST API. The service eliminates the complexity of building custom data processing infrastructure while maintaining the flexibility to handle diverse transformation requirements.

For complete API documentation and advanced configuration options, visit the PipelineAPI documentation.

Top comments (0)