Untersuchung Notizbücher

Greifen Sie auf Notizbücher innerhalb einer Untersuchung zu. Notizbücher enthalten die Analyseblöcke, die Prozess-Mining-Workflows definieren.

Voraussetzungen

Bevor Sie auf Notizbücher über diese API zugreifen, müssen Sie das Projekt über die Project API in den Cache laden.

# Zuerst Projekt in den Cache laden
curl -X GET "https://your-mindzie-instance.com/api/{tenantId}/project/{projectId}/load" \
  -H "Authorization: Bearer YOUR_API_KEY"

Details finden Sie in der Project Cache API.


Liste der Untersuchung Notizbücher

GET /api/{tenantId}/{projectId}/investigation/{investigationId}/notebooks

Ruft alle Notizbücher innerhalb einer Untersuchung aus dem Projekt-Cache ab.

Pfadparameter

Parameter Typ Erforderlich Beschreibung
tenantId GUID Ja Die Mandantenkennung
projectId GUID Ja Die Projektkennung
investigationId GUID Ja Die Untersuchungserkennung

Antwort (200 OK)

{
  "notebooks": [
    {
      "notebookId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "investigationId": "11111111-2222-3333-4444-555555555555",
      "name": "Main",
      "description": "",
      "dateCreated": "2024-01-15T10:30:00Z",
      "dateModified": "2024-01-20T14:45:00Z",
      "createdBy": null,
      "modifiedBy": null,
      "notebookType": null,
      "notebookOrder": 1.0,
      "lastExecutionDuration": 0,
      "blockCount": 12
    },
    {
      "notebookId": "bbbbbbbb-cccc-dddd-eeee-ffffffffffff",
      "investigationId": "11111111-2222-3333-4444-555555555555",
      "name": "Variant Analysis",
      "description": "",
      "dateCreated": "2024-01-16T09:00:00Z",
      "dateModified": "2024-01-18T11:30:00Z",
      "createdBy": null,
      "modifiedBy": null,
      "notebookType": null,
      "notebookOrder": 2.0,
      "lastExecutionDuration": 0,
      "blockCount": 8
    }
  ],
  "totalCount": 2
}

Notizbuch Objektfelder

Feld Typ Beschreibung
notebookId GUID Eindeutige Kennung des Notizbuchs
investigationId GUID Untersuchung, zu der dieses Notizbuch gehört
name string Anzeigename des Notizbuchs
description string Beschreibung des Notizbuchs
dateCreated datetime Erstellungsdatum des Notizbuchs
dateModified datetime Letztes Änderungsdatum des Notizbuchs
createdBy GUID Benutzer, der das Notizbuch erstellt hat
modifiedBy GUID Benutzer, der das Notizbuch zuletzt geändert hat
notebookType integer Typ des Notizbuchs (0 = Standard)
notebookOrder decimal Anzeigereihenfolge innerhalb der Untersuchung
lastExecutionDuration double Letzte Ausführungsdauer in Sekunden
blockCount integer Anzahl der Blöcke im Notizbuch

Fehlerantworten

Nicht gefunden (404) - Projekt nicht im Cache:

"Project not found in cache. Please load the project first using the ProjectController.LoadProject endpoint."

Nicht gefunden (404) - Untersuchung nicht gefunden:

{
  "error": "Investigation not found",
  "investigationId": "11111111-2222-3333-4444-555555555555"
}

Hauptnotizbuch abrufen

GET /api/{tenantId}/{projectId}/investigation/{investigationId}/main-notebook

Ruft das Hauptnotizbuch für eine Untersuchung ab. Das Hauptnotizbuch wird automatisch erstellt, wenn eine Untersuchung angelegt wird, und enthält normalerweise die grundlegenden Filter- und Analyse-Workflows.

Pfadparameter

Parameter Typ Erforderlich Beschreibung
tenantId GUID Ja Die Mandantenkennung
projectId GUID Ja Die Projektkennung
investigationId GUID Ja Die Untersuchungserkennung

Antwort (200 OK)

{
  "notebookId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
  "investigationId": "11111111-2222-3333-4444-555555555555",
  "name": "Main",
  "description": "Primary analysis notebook",
  "dateCreated": "2024-01-15T10:30:00Z",
  "dateModified": "2024-01-20T14:45:00Z",
  "createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "modifiedBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "notebookType": 0,
  "notebookOrder": 1.0,
  "lastExecutionDuration": 2.5,
  "blockCount": 12
}

Fehlerantworten

Nicht gefunden (404) - Untersuchung nicht gefunden:

{
  "error": "Investigation not found",
  "investigationId": "11111111-2222-3333-4444-555555555555"
}

Nicht gefunden (404) - Hauptnotizbuch nicht gefunden:

{
  "error": "Main notebook not found for investigation",
  "investigationId": "11111111-2222-3333-4444-555555555555"
}

Implementierungsbeispiele

cURL

# Schritt 1: Zuerst Projekt in den Cache laden
curl -X GET "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/project/87654321-4321-4321-4321-210987654321/load" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

# Schritt 2: Alle Notizbücher einer Untersuchung auflisten
curl -X GET "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/investigation/11111111-2222-3333-4444-555555555555/notebooks" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

# Hauptnotizbuch direkt abrufen
curl -X GET "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/investigation/11111111-2222-3333-4444-555555555555/main-notebook" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

Python

import requests

TENANT_ID = '12345678-1234-1234-1234-123456789012'
PROJECT_ID = '87654321-4321-4321-4321-210987654321'
BASE_URL = 'https://your-mindzie-instance.com'

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

    def load_project(self):
        """Lädt das Projekt in den Cache, bevor Notizbücher abgerufen werden."""
        url = f'{BASE_URL}/api/{TENANT_ID}/project/{PROJECT_ID}/load'
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def list_notebooks(self, investigation_id):
        """Listet alle Notizbücher in einer Untersuchung auf."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation/{investigation_id}/notebooks'
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def get_main_notebook(self, investigation_id):
        """Ruft das Hauptnotizbuch einer Untersuchung ab."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation/{investigation_id}/main-notebook'
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

# Verwendung
accessor = NotebookAccessor('your-auth-token')
investigation_id = '11111111-2222-3333-4444-555555555555'

# Schritt 1: Projekt in den Cache laden
print("Projekt wird in den Cache geladen...")
load_result = accessor.load_project()
print(f"Projekt geladen: {load_result['projectName']}")

# Schritt 2: Notizbücher auflisten
notebooks = accessor.list_notebooks(investigation_id)
print(f"\nEs wurden {notebooks['totalCount']} Notizbücher gefunden:")

for nb in notebooks['notebooks']:
    print(f"  - {nb['name']}: {nb['blockCount']} Blöcke")

# Hauptnotizbuch abrufen
main = accessor.get_main_notebook(investigation_id)
print(f"\nHauptnotizbuch: {main['name']} ({main['blockCount']} Blöcke)")

JavaScript/Node.js

const TENANT_ID = '12345678-1234-1234-1234-123456789012';
const PROJECT_ID = '87654321-4321-4321-4321-210987654321';
const BASE_URL = 'https://your-mindzie-instance.com';

class NotebookAccessor {
  constructor(token) {
    this.headers = {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    };
  }

  async loadProject() {
    const url = `${BASE_URL}/api/${TENANT_ID}/project/${PROJECT_ID}/load`;
    const response = await fetch(url, { headers: this.headers });
    if (!response.ok) throw new Error(`Fehler: ${response.status}`);
    return await response.json();
  }

  async listNotebooks(investigationId) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/investigation/${investigationId}/notebooks`;
    const response = await fetch(url, { headers: this.headers });
    if (!response.ok) throw new Error(`Fehler: ${response.status}`);
    return await response.json();
  }

  async getMainNotebook(investigationId) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/investigation/${investigationId}/main-notebook`;
    const response = await fetch(url, { headers: this.headers });
    if (!response.ok) throw new Error(`Fehler: ${response.status}`);
    return await response.json();
  }
}

// Verwendung
const accessor = new NotebookAccessor('your-auth-token');
const investigationId = '11111111-2222-3333-4444-555555555555';

// Schritt 1: Projekt in Cache laden...
console.log('Projekt wird in den Cache geladen...');
const loadResult = await accessor.loadProject();
console.log(`Projekt geladen: ${loadResult.projectName}`);

// Schritt 2: Notizbücher auflisten
const notebooks = await accessor.listNotebooks(investigationId);
console.log(`\nEs wurden ${notebooks.totalCount} Notizbücher gefunden:`);

notebooks.notebooks.forEach(nb => {
  console.log(`  - ${nb.name}: ${nb.blockCount} Blöcke`);
});

// Hauptnotizbuch abrufen
const main = await accessor.getMainNotebook(investigationId);
console.log(`\nHauptnotizbuch: ${main.name} (${main.blockCount} Blöcke)`);

Best Practices

  1. Projekt immer zuerst laden: Stellen Sie sicher, dass das Projekt vor dem Zugriff auf Notizbücher in den Cache geladen wurde
  2. Cache-Dauer: Projekte bleiben 30 Minuten nach dem letzten Zugriff im Cache
  3. Session-Touch: API-Aufrufe verlängern automatisch die Cache-Lebensdauer
  4. Hauptnotizbuch verwenden: Für grundlegende Analysen enthält das Hauptnotizbuch den primären Workflow
  5. Notizbuch-Reihenfolge: Notizbücher werden nach notebookOrder für eine konsistente Anzeige sortiert