Gestion des Investigations

Gérez les investigations au sein des projets mindzieStudio. Créez, récupérez, mettez à jour et supprimez des investigations contenant des notebooks et définissant des workflows d'analyse de processus mining.

Test de Connectivité

Ping Non Autorisé

GET /api/{tenantId}/{projectId}/investigation/unauthorized-ping

Point de terminaison de test ne nécessitant pas d'authentification. Utilisez cela pour vérifier la connectivité réseau.

Réponse

Ping Successful

Ping Authentifié

GET /api/{tenantId}/{projectId}/investigation/ping

Point de terminaison de ping authentifié pour vérifier l'accès à l'API pour un locataire et projet spécifiques.

Réponse (200 OK)

Ping Successful (tenant id: {tenantId})

Lister Toutes les Investigations

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

Récupère une liste paginée de toutes les investigations dans le projet spécifié.

Paramètres de Chemin

Paramètre Type Obligatoire Description
tenantId GUID Oui Identifiant du locataire
projectId GUID Oui Identifiant du projet

Paramètres de Requête

Paramètre Type Défaut Description
page entier 1 Numéro de page pour la pagination
pageSize entier 50 Nombre d'éléments par page (max recommandé : 100)

Réponse (200 OK)

{
  "investigations": [
    {
      "investigationId": "11111111-2222-3333-4444-555555555555",
      "projectId": "87654321-4321-4321-4321-210987654321",
      "investigationName": "Order Analysis",
      "investigationDescription": "Process mining analysis of order workflow",
      "datasetId": "12345678-1234-1234-1234-123456789012",
      "dateCreated": "2024-01-15T10:30:00Z",
      "dateModified": "2024-01-20T14:45:00Z",
      "createdBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "modifiedBy": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "investigationOrder": 1.0,
      "isUsedForOperationCenter": false,
      "investigationFolderId": null,
      "notebookCount": 3
    }
  ],
  "totalCount": 5,
  "page": 1,
  "pageSize": 50
}

Champs de l'Objet Investigation

Champ Type Description
investigationId GUID Identifiant unique de l'investigation
projectId GUID Projet auquel cette investigation appartient
investigationName string Nom affiché de l'investigation
investigationDescription string Description de l'investigation
datasetId GUID Ensemble de données analysé par l'investigation
dateCreated datetime Date de création de l'investigation
dateModified datetime Date de la dernière modification de l'investigation
createdBy GUID Utilisateur ayant créé l'investigation
modifiedBy GUID Utilisateur ayant modifié l'investigation en dernier
investigationOrder decimal Ordre d'affichage dans le projet
isUsedForOperationCenter boolean Utilisé pour la surveillance en temps réel
investigationFolderId GUID Dossier optionnel pour l'organisation
notebookCount integer Nombre de notebooks dans l'investigation

Obtenir les Détails d'une Investigation

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

Récupère les informations détaillées d'une investigation spécifique.

Paramètres de Chemin

Paramètre Type Obligatoire Description
tenantId GUID Oui Identifiant du locataire
projectId GUID Oui Identifiant du projet
investigationId GUID Oui Identifiant de l'investigation

Réponse (200 OK)

Même structure que l'objet investigation dans la réponse de liste.

Réponses d'Erreur

Non Trouvé (404) :

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

Créer une Investigation

POST /api/{tenantId}/{projectId}/investigation

Crée une nouvelle investigation liée à un dataset existant. Un notebook principal est créé automatiquement.

Paramètres de Chemin

Paramètre Type Obligatoire Description
tenantId GUID Oui Identifiant du locataire
projectId GUID Oui Identifiant du projet

Corps de la Requête

{
  "investigationName": "Order Analysis",
  "investigationDescription": "Process mining analysis of order workflow",
  "datasetId": "12345678-1234-1234-1234-123456789012",
  "isUsedForOperationCenter": false
}

Champs de la Requête

Champ Type Obligatoire Description
investigationName string Oui Nom de l'investigation
investigationDescription string Non Description de l'investigation
datasetId GUID Oui Ensemble de données à analyser
isUsedForOperationCenter boolean Non Activation pour la surveillance en temps réel (par défaut : false)

Réponse (201 Created)

Retourne l'objet investigation créée (même structure que Get Investigation).

Réponses d'Erreur

Mauvaise Requête (400) :

{
  "error": "Dataset not found with ID '12345678-1234-1234-1234-123456789012'"
}

Mettre à Jour une Investigation

PUT /api/{tenantId}/{projectId}/investigation/{investigationId}

Met à jour les propriétés d'une investigation existante. Tous les champs sont optionnels.

Paramètres de Chemin

Paramètre Type Obligatoire Description
tenantId GUID Oui Identifiant du locataire
projectId GUID Oui Identifiant du projet
investigationId GUID Oui Identifiant de l'investigation

Corps de la Requête

{
  "investigationName": "Updated Analysis Name",
  "investigationDescription": "Updated description",
  "isUsedForOperationCenter": true
}

Champs de la Requête

Champ Type Obligatoire Description
investigationName string Non Nouveau nom de l'investigation
investigationDescription string Non Nouvelle description
isUsedForOperationCenter boolean Non Activer/désactiver le centre d'opération

Réponse (200 OK)

Retourne l'objet investigation mise à jour.

Réponses d'Erreur

Non Trouvé (404) :

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

Supprimer une Investigation

DELETE /api/{tenantId}/{projectId}/investigation/{investigationId}

Supprime définitivement une investigation et TOUS les notebooks associés.

ATTENTION : Il s'agit d'une opération DESTRUCTRICE qui NE PEUT PAS être annulée.

Suppression en Cascade Inclut

  • Tous les notebooks de l'investigation
  • Toutes les configurations de blocs
  • Tout l'historique d'exécution
  • Tous les résultats d'analyse

Paramètres de Chemin

Paramètre Type Obligatoire Description
tenantId GUID Oui Identifiant du locataire
projectId GUID Oui Identifiant du projet
investigationId GUID Oui Identifiant de l'investigation

Réponse (204 No Content)

Pas de corps de réponse en cas de suppression réussie.

Réponses d'Erreur

Non Trouvé (404) :

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

Exemples d'Implémentation

cURL

# Lister toutes les investigations
curl -X GET "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/investigation" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

# Obtenir les détails d'une investigation
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" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

# Créer une nouvelle investigation
curl -X POST "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/investigation" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "investigationName": "Q4 Analysis",
    "investigationDescription": "Quarterly order analysis",
    "datasetId": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
  }'

# Mettre à jour une investigation
curl -X PUT "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/investigation/11111111-2222-3333-4444-555555555555" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "investigationName": "Q4 Analysis - Final",
    "investigationDescription": "Updated description"
  }'

# Supprimer une investigation (ATTENTION : Irréversible !)
curl -X DELETE "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/investigation/11111111-2222-3333-4444-555555555555" \
  -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 InvestigationManager:
    def __init__(self, token):
        self.headers = {
            'Authorization': f'Bearer {token}',
            'Content-Type': 'application/json'
        }

    def list_investigations(self, page=1, page_size=50):
        """Liste toutes les investigations du projet."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation'
        params = {'page': page, 'pageSize': page_size}
        response = requests.get(url, headers=self.headers, params=params)
        response.raise_for_status()
        return response.json()

    def get_investigation(self, investigation_id):
        """Obtient les détails d'une investigation."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation/{investigation_id}'
        response = requests.get(url, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def create_investigation(self, name, dataset_id, description='', is_operation_center=False):
        """Crée une nouvelle investigation."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation'
        payload = {
            'investigationName': name,
            'investigationDescription': description,
            'datasetId': dataset_id,
            'isUsedForOperationCenter': is_operation_center
        }
        response = requests.post(url, json=payload, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def update_investigation(self, investigation_id, name=None, description=None, is_operation_center=None):
        """Met à jour une investigation existante."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation/{investigation_id}'
        payload = {}
        if name:
            payload['investigationName'] = name
        if description is not None:
            payload['investigationDescription'] = description
        if is_operation_center is not None:
            payload['isUsedForOperationCenter'] = is_operation_center
        response = requests.put(url, json=payload, headers=self.headers)
        response.raise_for_status()
        return response.json()

    def delete_investigation(self, investigation_id):
        """Supprime une investigation (ATTENTION : Irréversible !)."""
        url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/investigation/{investigation_id}'
        response = requests.delete(url, headers=self.headers)
        response.raise_for_status()
        return None  # 204 No Content

# Utilisation
manager = InvestigationManager('your-auth-token')

# Lister toutes les investigations
result = manager.list_investigations()
print(f"Total des investigations : {result['totalCount']}")

for inv in result['investigations']:
    print(f"- {inv['investigationName']} : {inv['notebookCount']} notebooks")

# Créer une nouvelle investigation
new_inv = manager.create_investigation(
    name='API Test Investigation',
    dataset_id='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
    description='Created via API'
)
print(f"Créée : {new_inv['investigationId']}")

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 InvestigationManager {
  constructor(token) {
    this.headers = {
      'Authorization': `Bearer ${token}`,
      'Content-Type': 'application/json'
    };
  }

  async listInvestigations(page = 1, pageSize = 50) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/investigation?page=${page}&pageSize=${pageSize}`;
    const response = await fetch(url, { headers: this.headers });
    if (!response.ok) throw new Error(`Failed: ${response.status}`);
    return await response.json();
  }

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

  async createInvestigation(name, datasetId, description = '', isOperationCenter = false) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/investigation`;
    const response = await fetch(url, {
      method: 'POST',
      headers: this.headers,
      body: JSON.stringify({
        investigationName: name,
        investigationDescription: description,
        datasetId: datasetId,
        isUsedForOperationCenter: isOperationCenter
      })
    });
    if (!response.ok) throw new Error(`Failed: ${response.status}`);
    return await response.json();
  }

  async updateInvestigation(investigationId, updates) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/investigation/${investigationId}`;
    const response = await fetch(url, {
      method: 'PUT',
      headers: this.headers,
      body: JSON.stringify(updates)
    });
    if (!response.ok) throw new Error(`Failed: ${response.status}`);
    return await response.json();
  }

  async deleteInvestigation(investigationId) {
    const url = `${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/investigation/${investigationId}`;
    const response = await fetch(url, {
      method: 'DELETE',
      headers: this.headers
    });
    if (!response.ok) throw new Error(`Failed: ${response.status}`);
    return null; // 204 No Content
  }
}

// Utilisation
const manager = new InvestigationManager('your-auth-token');

const investigations = await manager.listInvestigations();
console.log(`Trouvé ${investigations.totalCount} investigations`);

investigations.investigations.forEach(inv => {
  console.log(`- ${inv.investigationName} : ${inv.notebookCount} notebooks`);
});

// Créer une nouvelle investigation
const newInv = await manager.createInvestigation(
  'API Test Investigation',
  'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
  'Created via API'
);
console.log(`Créée : ${newInv.investigationId}`);