調査管理

mindzieStudioプロジェクト内で調査を管理します。ノートブックを含む調査を作成、取得、更新、削除し、プロセスマイニング分析ワークフローを定義します。

接続テスト

認証不要のPing

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

認証不要のテストエンドポイントです。ネットワーク接続を確認するために使用します。

レスポンス

Ping Successful

認証済みPing

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

特定のテナントとプロジェクトのAPIアクセスを検証するための認証済みPingエンドポイント。

レスポンス (200 OK)

Ping Successful (tenant id: {tenantId})

すべての調査の一覧取得

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

指定されたプロジェクト内のすべての調査のページネーション付きリストを取得します。

パスパラメータ

パラメータ 種類 必須 説明
tenantId GUID はい テナント識別子
projectId GUID はい プロジェクト識別子

クエリパラメータ

パラメータ 種類 デフォルト 説明
page 整数 1 ページ番号
pageSize 整数 50 1ページあたりの項目数(推奨最大: 100)

レスポンス (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
}

調査オブジェクトのフィールド

フィールド 種類 説明
investigationId GUID 調査の一意識別子
projectId GUID 調査が属するプロジェクト
investigationName 文字列 調査の表示名
investigationDescription 文字列 調査の説明
datasetId GUID 分析対象のデータセット
dateCreated 日時 調査が作成された日時
dateModified 日時 最後に変更された日時
createdBy GUID 調査を作成したユーザー
modifiedBy GUID 調査を最後に変更したユーザー
investigationOrder 小数 プロジェクト内での表示順
isUsedForOperationCenter ブール値 リアルタイム監視に使用されているか
investigationFolderId GUID 組織用に設定されたフォルダー(任意)
notebookCount 整数 調査内のノートブック数

調査の詳細取得

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

特定の調査の詳細情報を取得します。

パスパラメータ

パラメータ 種類 必須 説明
tenantId GUID はい テナント識別子
projectId GUID はい プロジェクト識別子
investigationId GUID はい 調査識別子

レスポンス (200 OK)

一覧レスポンスの調査オブジェクトと同一の構造。

エラー応答

Not Found (404):

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

調査の作成

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

既存のデータセットに紐づく新しい調査を作成します。メインノートブックが自動的に作成されます。

パスパラメータ

パラメータ 種類 必須 説明
tenantId GUID はい テナント識別子
projectId GUID はい プロジェクト識別子

リクエストボディ

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

リクエストフィールド

フィールド 種類 必須 説明
investigationName 文字列 はい 調査名
investigationDescription 文字列 いいえ 調査の説明
datasetId GUID はい 分析対象のデータセット
isUsedForOperationCenter ブール値 いいえ リアルタイム監視の有効化(デフォルト:false)

レスポンス (201 Created)

作成された調査オブジェクトを返します(Get Investigationと同一構造)。

エラー応答

Bad Request (400):

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

調査の更新

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

既存の調査プロパティを更新します。すべてのフィールドは任意です。

パスパラメータ

パラメータ 種類 必須 説明
tenantId GUID はい テナント識別子
projectId GUID はい プロジェクト識別子
investigationId GUID はい 調査識別子

リクエストボディ

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

リクエストフィールド

フィールド 種類 必須 説明
investigationName 文字列 いいえ 新しい調査名
investigationDescription 文字列 いいえ 新しい説明
isUsedForOperationCenter ブール値 いいえ オペレーションセンターの有効/無効

レスポンス (200 OK)

更新された調査オブジェクトを返します。

エラー応答

Not Found (404):

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

調査の削除

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

調査と関連するすべてのノートブックを完全に削除します。

警告:これは取り消し不可能な破壊的操作です。

カスケード削除対象

  • 調査内のすべてのノートブック
  • すべてのブロック設定
  • すべての実行履歴
  • すべての分析結果

パスパラメータ

パラメータ 種類 必須 説明
tenantId GUID はい テナント識別子
projectId GUID はい プロジェクト識別子
investigationId GUID はい 調査識別子

レスポンス (204 No Content)

削除成功時はレスポンスボディなし。

エラー応答

Not Found (404):

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

実装例

cURL

# すべての調査を一覧表示
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"

# 調査の詳細を取得
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"

# 新しい調査を作成
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"
  }'

# 調査を更新
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"
  }'

# 調査を削除(注意:不可逆)
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):
        """プロジェクト内のすべての調査を一覧表示します。"""
        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):
        """調査の詳細を取得します。"""
        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):
        """新しい調査を作成します。"""
        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):
        """既存の調査を更新します。"""
        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):
        """調査を削除します(注意:不可逆)。"""
        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

# 使用例
manager = InvestigationManager('your-auth-token')

# すべての調査を一覧表示
result = manager.list_investigations()
print(f"Total investigations: {result['totalCount']}")

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

# 新しい調査を作成
new_inv = manager.create_investigation(
    name='API Test Investigation',
    dataset_id='aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
    description='Created via API'
)
print(f"Created: {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
  }
}

// 使用例
const manager = new InvestigationManager('your-auth-token');

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

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

// 新しい調査を作成
const newInv = await manager.createInvestigation(
  'API Test Investigation',
  'aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
  'Created via API'
);
console.log(`Created: ${newInv.investigationId}`);