URL-Generierung

Entity-URLs generieren

GET /api/{tenantId}/url/generate

Erstellen Sie direkte URLs zu mindzieStudio-Seiten und Entitäten. Diese API erzeugt korrekt formatierte URLs zur Navigation zu Projekten, Dashboards, Untersuchungen, Notebooks, Blöcken und anderen Entitäten.

Authentifizierung

Erfordert Bearer-Token-Authentifizierung:

Authorization: Bearer {api_key}

Anfrage

GET /api/{tenantId}/url/generate?type={urlType}&entityId={id}&parentId={parentId}
Authorization: Bearer {token}

Pfad-Parameter

Parameter Typ Erforderlich Beschreibung
tenantId GUID Ja Der Mandantenbezeichner

Query-Parameter

Parameter Typ Erforderlich Beschreibung
type String Ja Der zu generierende URL-Typ (siehe URL-Typen unten)
entityId GUID Bedingt Entity-ID für entitätsspezifische Seiten
parentId GUID Bedingt Übergeordnete ID (projectId oder notebookId abhängig vom Typ)
baseUrl String Nein Überschreibt die Basis-URL (Standard ist Ursprungs-URL der Anfrage)

URL-Typen

Listen-Seiten

Diese URL-Typen liefern direkte URLs zu Listen-/Übersichtsseiten:

Typ parentId erforderlich Generiertes URL-Muster
projects Nein /projects?tenantId={tenantId}
apps Nein /apps?tenantId={tenantId}
investigations Ja (projectId) /investigations?projectId={parentId}
dashboards-list Ja (projectId) /dashboards?projectId={parentId}
datasets Ja (projectId) /manage-datasets?projectId={parentId}
actions Ja (projectId) /actions?projectId={parentId}
bpmn Ja (projectId) /bpmn-editor?projectId={parentId}

Entity-Seiten

Diese URL-Typen liefern /navigate-URLs, die zu spezifischen Entitäten führen:

Typ entityId parentId Beschreibung
dashboard dashboardId - Einzelansicht eines Dashboards
analysis notebookId - Notebook-/Analyse-Seite
block blockId notebookId Spezifischer Block auf einer Notebook-Seite
enrichment enrichmentNotebookId projectId (optional) Enrichment-Notebook

Antwort

Antwortstruktur

{
  "url": "https://your-instance.mindziestudio.com/projects?tenantId=...",
  "entityType": "projects",
  "entityId": null,
  "tenantId": "660e8400-e29b-41d4-a716-446655440000"
}

Antwortfelder

Feld Typ Beschreibung
url String Die vollständig qualifizierte URL zur angeforderten Seite oder Entität
entityType String Der generierte URL-Typ (entspricht dem Parameter type)
entityId GUID oder null Die Entity-ID, falls eine entitätsspezifische URL generiert wurde
tenantId GUID Die in der Anfrage verwendete Tenant-ID

Beispiele

Listen-Seiten

URL zur Projektliste abrufen

curl -H "Authorization: Bearer {api_key}" \
  "https://host/api/{tenantId}/url/generate?type=projects"

Antwort:

{
  "url": "https://host/projects?tenantId=660e8400-e29b-41d4-a716-446655440000",
  "entityType": "projects",
  "entityId": null,
  "tenantId": "660e8400-e29b-41d4-a716-446655440000"
}

Untersuchungen für ein Projekt abrufen

curl -H "Authorization: Bearer {api_key}" \
  "https://host/api/{tenantId}/url/generate?type=investigations&parentId={projectId}"

Antwort:

{
  "url": "https://host/investigations?projectId=770e8400-e29b-41d4-a716-446655440001",
  "entityType": "investigations",
  "entityId": null,
  "tenantId": "660e8400-e29b-41d4-a716-446655440000"
}

Dashboard-Liste für ein Projekt abrufen

curl -H "Authorization: Bearer {api_key}" \
  "https://host/api/{tenantId}/url/generate?type=dashboards-list&parentId={projectId}"

Entity-Seiten

curl -H "Authorization: Bearer {api_key}" \
  "https://host/api/{tenantId}/url/generate?type=dashboard&entityId={dashboardId}"

Antwort:

{
  "url": "https://host/navigate?type=dashboard&id=880e8400-e29b-41d4-a716-446655440002",
  "entityType": "dashboard",
  "entityId": "880e8400-e29b-41d4-a716-446655440002",
  "tenantId": "660e8400-e29b-41d4-a716-446655440000"
}
curl -H "Authorization: Bearer {api_key}" \
  "https://host/api/{tenantId}/url/generate?type=analysis&entityId={notebookId}"
curl -H "Authorization: Bearer {api_key}" \
  "https://host/api/{tenantId}/url/generate?type=block&entityId={blockId}&parentId={notebookId}"

Antwort:

{
  "url": "https://host/navigate?type=block&id=990e8400-e29b-41d4-a716-446655440003&notebookId=aa0e8400-e29b-41d4-a716-446655440004",
  "entityType": "block",
  "entityId": "990e8400-e29b-41d4-a716-446655440003",
  "tenantId": "660e8400-e29b-41d4-a716-446655440000"
}

JavaScript-Beispiel

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

  async generateUrl(type, options = {}) {
    const params = new URLSearchParams({ type });

    if (options.entityId) {
      params.append('entityId', options.entityId);
    }
    if (options.parentId) {
      params.append('parentId', options.parentId);
    }
    if (options.baseUrl) {
      params.append('baseUrl', options.baseUrl);
    }

    const response = await fetch(
      `${this.baseUrl}/api/${this.tenantId}/url/generate?${params}`,
      { headers: this.headers }
    );

    if (!response.ok) {
      throw new Error(`Fehler bei der URL-Generierung: ${response.status}`);
    }

    return response.json();
  }

  // Komfortfunktionen
  async getProjectsUrl() {
    return this.generateUrl('projects');
  }

  async getInvestigationsUrl(projectId) {
    return this.generateUrl('investigations', { parentId: projectId });
  }

  async getDashboardUrl(dashboardId) {
    return this.generateUrl('dashboard', { entityId: dashboardId });
  }

  async getBlockUrl(blockId, notebookId) {
    return this.generateUrl('block', {
      entityId: blockId,
      parentId: notebookId
    });
  }
}

// Verwendung
const urlGen = new UrlGenerator(
  'https://your-instance.mindziestudio.com',
  'tenant-guid',
  'your-api-token'
);

// URL zur Projektliste abrufen
const projectsUrl = await urlGen.getProjectsUrl();
console.log('Projects URL:', projectsUrl.url);

// URL zu einem spezifischen Dashboard abrufen
const dashboardUrl = await urlGen.getDashboardUrl('dashboard-guid');
console.log('Dashboard URL:', dashboardUrl.url);

// URL zu einem spezifischen Block abrufen
const blockUrl = await urlGen.getBlockUrl('block-guid', 'notebook-guid');
console.log('Block URL:', blockUrl.url);

Python-Beispiel

import requests
from typing import Optional, Dict, Any

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

    def generate_url(
        self,
        url_type: str,
        entity_id: Optional[str] = None,
        parent_id: Optional[str] = None,
        base_url_override: Optional[str] = None
    ) -> Dict[str, Any]:
        """Generiert eine URL für den angegebenen Typ und die Entity"""
        params = {'type': url_type}

        if entity_id:
            params['entityId'] = entity_id
        if parent_id:
            params['parentId'] = parent_id
        if base_url_override:
            params['baseUrl'] = base_url_override

        url = f"{self.base_url}/api/{self.tenant_id}/url/generate"
        response = requests.get(url, params=params, headers=self.headers)
        response.raise_for_status()
        return response.json()

    # Komfortfunktionen für Listen-Seiten
    def get_projects_url(self) -> str:
        return self.generate_url('projects')['url']

    def get_investigations_url(self, project_id: str) -> str:
        return self.generate_url('investigations', parent_id=project_id)['url']

    def get_dashboards_list_url(self, project_id: str) -> str:
        return self.generate_url('dashboards-list', parent_id=project_id)['url']

    def get_datasets_url(self, project_id: str) -> str:
        return self.generate_url('datasets', parent_id=project_id)['url']

    def get_actions_url(self, project_id: str) -> str:
        return self.generate_url('actions', parent_id=project_id)['url']

    # Komfortfunktionen für Entity-Seiten
    def get_dashboard_url(self, dashboard_id: str) -> str:
        return self.generate_url('dashboard', entity_id=dashboard_id)['url']

    def get_analysis_url(self, notebook_id: str) -> str:
        return self.generate_url('analysis', entity_id=notebook_id)['url']

    def get_block_url(self, block_id: str, notebook_id: str) -> str:
        return self.generate_url('block', entity_id=block_id, parent_id=notebook_id)['url']

    def get_enrichment_url(self, enrichment_id: str, project_id: Optional[str] = None) -> str:
        return self.generate_url('enrichment', entity_id=enrichment_id, parent_id=project_id)['url']


# Verwendung
url_gen = UrlGenerator(
    'https://your-instance.mindziestudio.com',
    'tenant-guid',
    'your-api-token'
)

# Verschiedene URLs abrufen
projects_url = url_gen.get_projects_url()
print(f"Projekte: {projects_url}")

investigations_url = url_gen.get_investigations_url('project-guid')
print(f"Untersuchungen: {investigations_url}")

dashboard_url = url_gen.get_dashboard_url('dashboard-guid')
print(f"Dashboard: {dashboard_url}")

block_url = url_gen.get_block_url('block-guid', 'notebook-guid')
print(f"Block: {block_url}")

MCP Server-Integration

KI-Coding-Assistenten können URLs mit dem MCP-Server erzeugen:

mindzie_generate_url type="dashboard" entityId="{dashboardId}"

Siehe MCP Server Integration für vollständige Dokumentation.

Anwendungsfälle

Linkfreigabe

Erzeugen Sie teilbare URLs zu spezifischen Dashboards, Untersuchungen oder Analyseblöcken.

Integrations-Workflows

Erstellen Sie Navigationslinks in externen Systemen, die tief in mindzieStudio verlinken.

Ermöglichen Sie KI-Tools, spezifische Seiten in der Anwendung zu generieren und zu öffnen.

Automatisiertes Reporting

Fügen Sie direkte Links zu relevanten Dashboards oder Analysen in automatisierte Berichte ein.

Fehlerbehandlung

Statuscode Beschreibung
200 Erfolg - URL wurde generiert
400 Ungültige Anfrage - Falscher Typ oder fehlende erforderliche Parameter
401 Nicht autorisiert - Ungültiges oder fehlendes Authentifizierungs-Token
404 Nicht gefunden - Entität nicht gefunden (für entitätsspezifische URLs)