Skip to main content
You can use the Web API to download reports on operator workloads, processed documents, documents from specific clients, and other criteria. The parameters of the API methods are identical to those used for creating reports via the Administration and Monitoring Console GUI. The resulting CSV file is also identical to the CSV file created using the Administration and Monitoring Console GUI. For detailed information about various data collected by reports, please see the Reports section in the Administration and Monitoring Console help. To download reports, use a GET request and pass the following URI: http://localhost/FlexiCapture12/Monitoring/Report/GetCsv?reportType=<reportType>&filterParametersJson=<filterParametersJson>. In this URI, reportType and filterParametersJson can have the following values:

Name

Value

reportType

Report type. Possible values:

  • 1 - General Operators report
  • 3 - Processing Performance report
  • 9 - Site Performance report
  • 10 - License Consumption by Tenants report
  • 11 - License Consumption by Projects report

filterParametersJson

Parameters by which reports are generated. The set of parameters depends on the report type. See detailed information about the parameters for each report:

You can find the example of using this API in the script. Download the script here or use the script code provided below.
# Auth parameters
$endpoint = "https://preprod01.flexicapture.com"
$tenant = "tenantName"
$user = "FCUserName"
$pass = "password"
$filePath = "c:\temp\report.csv"
# Report parameters
$reportType = 3
$jsonparameters = @"
[
{
"Name": "dateFrom",
"Value": "2022-08-31T21:00:00.000Z"
},
{
"Name": "dateTo",
"Value": "2022-09-01T21:00:00.000Z"
},
{
"Name": "projects",
"Value": [
5,
6,
7,
9,
10,
11,
12,
13,
14,
15,
16,
17,
19,
20,
28,
81,
221
]
},
{
"Name": "aggregateByBatchTypes",
"Value": true
},
{
"Name": "groupByType",
"Value": 1
},
{
"Name": "grouping",
"Value": "ProcessingStageName"
},
{
"Name": "columns",
"Value": [
"ProjectId",
"BatchTypeName",
"ProcessedBatchs",
"ProcessedDocs"
]
}
]
"@
###################################################
clear
$ErrorActionPreference="stop"
#Getting authTicket for authorization from FlexiCapture SOAP API
$tenantSuffix=""
$tenantInUrl = ""
if (($tenant -ne $null) -or ($tenant -eq "")) {
$tenantSuffix= "?Tenant="+$tenant
$tenantInUrl = "/$tenant"
}
$URL = $endpoint+'/FlexiCapture12/Server/FCAuth/API/Soap'+$tenantSuffix
$SOAPRequest = @"
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<FindUser xmlns="urn:http://www.abbyy.com/FlexiCapture">
<userLogin>$user</userLogin>
</FindUser>
</soap:Body>
</soap:Envelope>
"@
$pair = "$($user):$($pass)"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{
'SOAPAction' = '"#FindUser"'
'Content-Type' = 'text/xml; charset=utf-8'
'Authorization' = "$basicAuthValue"
}
$response = Invoke-WebRequest -Uri $URL `
-Headers $Headers `
-Body $SOAPRequest `
-Method 'POST' `
$authTicket = $response.Headers['AuthTicket']
#Creating auth Cookie
$session = [Microsoft.PowerShell.Commands.WebRequestSession]::new()
$cookie = [System.Net.Cookie]::new('FlexiCaptureTmpPrn', "Ticket=$authTicket")
$session.Cookies.Add($endpoint, $cookie)
# Request report via api and save it
$uriGet = $endpoint+ "/FlexiCapture12/Monitoring$tenantInUrl/Report/GetCSV?reportType=$reportType&filterParametersJson="
$uriGet += [uri]::EscapeDataString($jsonparameters)
$header = @{
"Accept" = "*/*"
"Accept-Encoding" = "gzip, deflate, br"
}
$response = Invoke-RestMethod -Uri $uriGet -Method 'GET' -Headers $header -WebSession $session -OutFile $filePath