Results

Retrieve Analysis Results

Access execution results, output data, and visualization configurations from completed block analyses. Get processed results from filters, calculations, and alerts.

Get Block Results

GET /api/{tenantId}/{projectId}/block/{blockId}/results

Retrieves the processed results from the block's most recent execution. Results may include filtered data, calculated metrics, alerts, or other analytical outputs depending on the block type.

Parameters

Parameter Type Location Description
tenantId GUID Path The tenant identifier
projectId GUID Path The project identifier
blockId GUID Path The block identifier

Response

{
  "blockId": "550e8400-e29b-41d4-a716-446655440000",
  "results": [
    {
      "id": 1,
      "type": "metric",
      "name": "Average Duration",
      "value": 145.7,
      "unit": "minutes",
      "timestamp": "2024-01-15T14:45:00Z"
    },
    {
      "id": 2,
      "type": "count",
      "name": "Total Cases",
      "value": 1250,
      "timestamp": "2024-01-15T14:45:00Z"
    }
  ],
  "message": "Block execution completed successfully"
}

Response Codes

  • 200 OK - Results retrieved successfully
  • 401 Unauthorized - Invalid authentication or insufficient permissions
  • 404 Not Found - Block not found or no access
  • 500 Internal Server Error - Server error occurred

Get Block Output Data

GET /api/{tenantId}/{projectId}/block/{blockId}/output-data

Retrieves the transformed dataset that results from the block's processing. This is typically the filtered, calculated, or enriched data that serves as input for subsequent blocks in the analysis workflow.

Parameters

Parameter Type Location Description
tenantId GUID Path The tenant identifier
projectId GUID Path The project identifier
blockId GUID Path The block identifier

Response

{
  "blockId": "550e8400-e29b-41d4-a716-446655440000",
  "dataType": "FilteredDataset",
  "data": [
    {
      "caseId": "CASE_001",
      "activity": "Order Created",
      "timestamp": "2024-01-15T09:00:00Z",
      "resource": "System",
      "duration": 120
    },
    {
      "caseId": "CASE_001",
      "activity": "Payment Processed",
      "timestamp": "2024-01-15T11:00:00Z",
      "resource": "Agent_A",
      "duration": 45
    }
  ],
  "metadata": {
    "totalRecords": 2450,
    "filteredRecords": 2,
    "executionTime": "2024-01-15T14:45:00Z"
  },
  "message": "Output data retrieved successfully"
}

Example: Retrieving Block Results

This example demonstrates fetching results from a completed block execution:

// JavaScript Example
const getBlockResults = async (blockId) => {
  try {
    const response = await fetch(`/api/${tenantId}/${projectId}/block/${blockId}/results`, {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      }
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const results = await response.json();

    // Process results
    results.results.forEach(result => {
      console.log(`${result.name}: ${result.value} ${result.unit || ''}`);
    });

    return results;
  } catch (error) {
    console.error('Error fetching block results:', error);
    throw error;
  }
};

// Get output data for further processing
const getBlockOutputData = async (blockId) => {
  try {
    const response = await fetch(`/api/${tenantId}/${projectId}/block/${blockId}/output-data`, {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${token}`,
        'Content-Type': 'application/json'
      }
    });

    const outputData = await response.json();
    console.log(`Retrieved ${outputData.data.length} records`);

    return outputData;
  } catch (error) {
    console.error('Error fetching output data:', error);
    throw error;
  }
};

Python Example

import requests
import json
from typing import Dict, List, Any

class BlockResultsManager:
    def __init__(self, base_url: str, tenant_id: str, project_id: str, token: str):
        self.base_url = base_url
        self.tenant_id = tenant_id
        self.project_id = project_id
        self.headers = {
            'Authorization': f'Bearer {token}',
            'Content-Type': 'application/json'
        }

    def get_block_results(self, block_id: str) -> Dict[str, Any]:
        """Get execution results for a specific block"""
        url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/block/{block_id}/results"

        try:
            response = requests.get(url, headers=self.headers)
            response.raise_for_status()

            results = response.json()
            print(f"Retrieved {len(results.get('results', []))} result items")

            return results
        except requests.exceptions.RequestException as e:
            print(f"Error fetching block results: {e}")
            raise

    def get_block_output_data(self, block_id: str) -> Dict[str, Any]:
        """Get output dataset from block execution"""
        url = f"{self.base_url}/api/{self.tenant_id}/{self.project_id}/block/{block_id}/output-data"

        try:
            response = requests.get(url, headers=self.headers)
            response.raise_for_status()

            output_data = response.json()
            metadata = output_data.get('metadata', {})
            print(f"Retrieved {len(output_data.get('data', []))} records")
            print(f"Total records: {metadata.get('totalRecords', 0)}")
            print(f"Filtered records: {metadata.get('filteredRecords', 0)}")

            return output_data
        except requests.exceptions.RequestException as e:
            print(f"Error fetching output data: {e}")
            raise

    def analyze_results(self, block_id: str) -> None:
        """Analyze block results and output data"""
        # Get results
        results = self.get_block_results(block_id)

        print("\n--- Block Results Analysis ---")
        for result in results.get('results', []):
            print(f"[Data] {result['name']}: {result['value']} {result.get('unit', '')}")

        # Get output data
        output_data = self.get_block_output_data(block_id)

        print(f"\n--- Output Data Summary ---")
        print(f"Data Type: {output_data.get('dataType', 'Unknown')}")
        print(f"Records Count: {len(output_data.get('data', []))}")

# Usage example
results_manager = BlockResultsManager(
    'https://your-mindzie-instance.com',
    'tenant-guid',
    'project-guid',
    'your-auth-token'
)

# Analyze block results
results_manager.analyze_results('block-guid')

Important Notes

Result Processing: Block results vary by type - filters return filtered datasets, calculators return computed metrics, and alerts return triggered conditions and notifications.

Best Practice: Always check the execution status before retrieving results. Use the Block Execution endpoints to monitor progress.

An error has occurred. This application may no longer respond until reloaded. Reload ??