API を使用したデータの取得

ビジネスプロセスレポートデータストレージへのパス

エントリーポイント:

/Reporting/BatchState/List
/Reporting/BatchState/File/<filename>
/Reporting/BatchState/View
/Reporting/BatchRouting/List
/Reporting/BatchRouting/File/<filename>
/Reporting/BatchRouting/View

データストレージへのフルパスは、変更可能なリンクです。

例:

http://localhost/Flexicapture12/Server/Reporting/BatchState/View

ABBYY FlexiCapture 認証モジュールを経由してアクセスする場合、以下のものがリンクに追加されます:/FCAuth

以下の場合、認証アクセスが許可されます:

    • 認証された ABBYY FlexiCapture ユーザーの場合
    • SAML/JWT トークンを使用している場合

例:

http://localhost/Flexicapture12/Server/FCAuth/Reporting/BatchState/View

テナントがデフォルトのテナントでない場合、以下のパラメーターがリンクに追加されます:?Tenant=<tenant name>

例:

http://localhost/Flexicapture12/Server/FCAuth/Reporting/BatchState/View?Tenant=myTenant

要求の作成

GET 要求のみが承認されます。

リストは JSON 形式でファイル名のリストを戻します。

ファイルは、指定した名前(URL 形式でエンコードされている必要があります)でファイルを戻します。

ビューは、HTML 形式でファイル名のリストを戻し、上記のファイルコマンドを使用してファイルへリンクを挿入します。従って、この要求を使用すると、提供されたリンクを使用してブラウザーでファイルを開き、そのコピーをローカルマシンに保存することができます。

例:

http://localhost/Flexicapture12/Server/FCAuth/Reporting/BatchState/View
http://localhost/Flexicapture12/Server/FCAuth/Reporting/BatchRouting/View

PowerShell スクリプトを使用したビジネスプロセスレポートの取得

以下のスクリプトを使用すると、管理者または監視オペレータのロールを持つテナントユーザーは、ビジネスプロセスモニターデータを取得できます。

レポートは、スクリプトの開始元のフォルダーに CSV 形式で保存されます。

$serviceHost = 'http://localhost' #Host
$user=$null #User
$pass=$null #Password
$tenant=$null #Tenant name

$baseUrl = $serviceHost
if( $user ) {
   $baseUrl += '/flexicapture12/server/FCAuth/Reporting/'
   } else {    $baseUrl += '/flexicapture12/server/Reporting/'
   }function createBasicCredentials() #Transforms password to encrypted strings
{
   $secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
   return New-Object System.Management.Automation.PSCredential($user, $secpasswd)
}

function getListFromUrl( $url ) #Authenticates using entered credentials
{
   if( $tenant ) {
       $url = $url + '?Tenant=' + [uri]::EscapeUriString( $tenant );
   }
   if( $user ) {
       $creds = createBasicCredentials -user $user -pass $pass
       $response = Invoke-WebRequest -Credential $creds -Uri $url;
   } else {
       $response = Invoke-WebRequest -UseDefaultCredentials -Uri $url;
   }
   $fileList = $response.ToString() | ConvertFrom-Json;
   return $fileList.reportFiles;
}

function getBatchStateFileList() #Requests a list of BatchState files
{
   $url = $baseUrl + 'BatchState/List';
   return getListFromUrl -url $url
}

function getBatchRoutingFileList() #Requests a list of BatchRouting files
{
   $url = $baseUrl + 'BatchRouting/List';
   return getListFromUrl -url $url
}

function downloadFile ( $fileName, $outDir ) #Downloads files  
{
   $url = $baseUrl + 'BatchState/File/' + [uri]::EscapeUriString( $fileName );
   if( $tenant ) {
       $url = $url + '?Tenant=' + [uri]::EscapeUriString( $tenant );
   }
   $outPath = Join-Path -Path $outDir -ChildPath $fileName
   if( $user ) {

       $creds = createBasicCredentials -user $user -pass $pass
       $response = Invoke-WebRequest -Credential $creds -Uri $url;
       $response = Invoke-WebRequest -Credential $creds -Uri $url -OutFile $outPath

   } else {
       $response = Invoke-WebRequest -UseDefaultCredentials -Uri $url -OutFile $outPath
   }
}

$files = getBatchStateFileList; #Uploads BatchState files to the current directory
foreach ($file in $files) {  
   downloadFile -fileName $file -outDir '.\'
}

$files = getBatchRoutingFileList; #Uploads BatchRouting files to the current directory
foreach ($file in $files) {  
   downloadFile -fileName $file -outDir '.\'
}

12.04.2024 18:16:07

Please leave your feedback about this article

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.