URL Generatie

Genereer Entiteit-URL's

GET /api/{tenantId}/url/generate

Genereer directe URL's naar mindzieStudio-pagina's en entiteiten. Deze API maakt correct opgemaakte URL's voor navigatie naar projecten, dashboards, onderzoeken, notitieboeken, blokken en andere entiteiten.

Authenticatie

Vereist Bearer-token authenticatie:

Authorization: Bearer {api_key}

Verzoek

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

Padparameters

Parameter Type Vereist Beschrijving
tenantId GUID Ja De tenant-identificatie

Queryparameters

Parameter Type Vereist Beschrijving
type String Ja Het URL-type dat gegenereerd moet worden (zie URL Types hieronder)
entityId GUID Voorwaardelijk Entiteit-ID voor entiteit-specifieke pagina's
parentId GUID Voorwaardelijk Parent-ID (projectId of notebookId afhankelijk van type)
baseUrl String Nee Overschrijf basis-URL (standaard de oorsprong van het verzoek)

URL Types

Lijstpagina's

Deze URL-types geven directe URL's terug naar lijst-/indexpagina's:

Type parentId Vereist Geproduceerd URL-patroon
projects Nee /projects?tenantId={tenantId}
apps Nee /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}

Entiteitpagina's

Deze URL-types geven /navigate URL's die leiden naar specifieke entiteiten:

Type entityId parentId Beschrijving
dashboard dashboardId - Enkelvoudige dashboardweergave
analysis notebookId - Notebook/analysespagina
block blockId notebookId Specifiek blok op een notebookpagina
enrichment enrichmentNotebookId projectId (optioneel) Verrijkingsnotebook

Antwoord

Antwoordstructuur

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

Antwoordvelden

Veld Type Beschrijving
url String De volledig gekwalificeerde URL naar de gevraagde pagina of entiteit
entityType String Het type URL dat gegenereerd is (komt overeen met de type parameter)
entityId GUID of null De entiteit-ID indien een entiteit-specifieke URL is gegenereerd
tenantId GUID De tenant-ID gebruikt in het verzoek

Voorbeelden

Lijstpagina's

URL voor Projectenlijst ophalen

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

Response:

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

Onderzoeken ophalen voor een project

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

Response:

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

Dashboardslijst ophalen voor een project

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

Entiteitpagina's

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

Response:

{
  "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}"

Response:

{
  "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 Voorbeeld

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(`Failed to generate URL: ${response.status}`);
    }

    return response.json();
  }

  // Handige methoden
  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
    });
  }
}

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

// URL naar projectenlijst ophalen
const projectsUrl = await urlGen.getProjectsUrl();
console.log('Projects URL:', projectsUrl.url);

// URL naar een specifiek dashboard ophalen
const dashboardUrl = await urlGen.getDashboardUrl('dashboard-guid');
console.log('Dashboard URL:', dashboardUrl.url);

// URL naar een specifiek blok ophalen
const blockUrl = await urlGen.getBlockUrl('block-guid', 'notebook-guid');
console.log('Block URL:', blockUrl.url);

Python Voorbeeld

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]:
        """Genereer een URL voor het opgegeven type en entiteit"""
        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()

    # Handige methoden voor lijstpagina's
    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']

    # Handige methoden voor entiteitpagina's
    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']


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

# Diverse URL's ophalen
projects_url = url_gen.get_projects_url()
print(f"Projects: {projects_url}")

investigations_url = url_gen.get_investigations_url('project-guid')
print(f"Investigations: {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 Integratie

AI-coding assistants kunnen URL's genereren via de MCP-server:

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

Zie MCP Server Integratie voor volledige documentatie.

Gebruiksscenario's

Genereer deelbare URL's naar specifieke dashboards, onderzoeken of analyseblokken.

Integratie Workflows

Maak navigatielinks in externe systemen die diep linken naar mindzieStudio.

Stel AI-tools in staat om specifieke pagina's in de applicatie te genereren en openen.

Geautomatiseerde Rapportage

Voeg directe links naar relevante dashboards of analyses toe in geautomatiseerde rapporten.

Foutafhandeling

Statuscode Beschrijving
200 Succes - URL gegenereerd
400 Fout in verzoek - Ongeldig type of ontbrekende verplichte parameters
401 Niet geautoriseerd - Ongeldig of ontbrekend authenticatietoken
404 Niet gevonden - Entiteit niet gevonden (voor entiteit-specifieke URL's)