An external system calls up the URL of the laboratory database Webservice with username and password and gets back the data record of the evaluation.
To make an evaluation available as web services for external systems, go to Edit evaluation and select "Activate HTTP authentication" (see figure) and assign a user name and password for HTTP authentication (Information on HTTP authentication).
Once data retrieval via HTTP authentication is enabled, data can be retrieved from an external system using the following URLs (replacing the X
in the URL with the number of the evaluation).
__URL__stats/view/X/https
__URL__stats/view/X/https_json
__URL__stats/view/X/https_json/VAR0/VAR1/VAR2/VAR3/VAR4/DATE/
The following values are possible for the variable DATE
: today, yesterday, last_3_days, this_month, last_month, last_6_month, last_12_month, this_year, last_year
//Retrieve evaluation
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_USERPWD, "$username:$password");
$json_data = curl_exec($curl);
curl_close($curl);
echo $json_data;
Windows PowerShell sample scripts for a download of a data set from an evaluation
Example 1
### Settings ### $downloadDirectory = ".\download\" $uri = "http://labordatenbank.com/demo/stats/view/1/https_json" $user = "testuser" $pass = "testpassword" ##################### $b64 = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:$pass")) $headers = @{ "Authorization" = "Basic $b64" } $download = Invoke-WebRequest -Uri $uri -Headers $headers -UseBasicParsing $content = [System.Net.Mime.ContentDisposition]::new($download.Headers["Content-Disposition"]) $fileName = $content.FileName $fullPath = Join-Path -Path $downloadDirectory -ChildPath $fileName Invoke-WebRequest -Uri $uri -Headers $headers -OutFile $fullPath
Example 2
### Settings ### $downloadDirectory = "XXX" $uri = "https://labordatenbank.com/XXX/stats/view/XXX/https_json" $user = "XXX" $pass = "XXX" $logFileName = "auswertungen.log" $fullLogPath = Join-Path -Path $downloadDirectory -ChildPath $logFileName Start-Transcript "$fullLogPath" -Append Base64 decoding¶ $b64 = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("${user}:$pass")) $headers = @{ "Authorization" = "Basic $b64" } Download¶ $download = Invoke-RestMethod -Uri $uri -Headers $headers -UseBasicParsing if($downloadDirectory){ foreach($entry in $download){ $downloadLink = $entry.'Download-Link' $fileName = $entry.Dateiname $fullPath = Join-Path -Path $downloadDirectory -ChildPath $fileName Write-Host "<--- $fileName --->" if(![System.IO.File]::Exists($fullPath)){ Invoke-WebRequest -Uri $downloadLink -OutFile $fullPath if($fullPath){ Write-Host "$filename Downloaded successfully." -ForegroundColor Green } else { Write-Host "Error when downloading the file." -ForegroundColor Red } } else { Write-Host "The file $fileName already exists!" -ForegroundColor Red } } } else { Write-Host "The path could not be found!" -ForegroundColor Red } Stop-Transcript
Last change: 10.01.2025
Allgemeines
Einführungsphase
Mitarbeiter
Aufträge
Proben
Probenvorlage
Berichte
Berichtstabellen Editor
Kunden
Kundenzone (optional)
Anlagen
Angebote
Rechnungen
Parameter
Rechnen mit Parametern
Schnittstellen
Webservice
Transformationscode
Prüfpläne / Grenzwerte / Spezifikationen
Dokumentenlenkung
Prüfmittel
Material
Mitarbeiterschulungen
8D-Report
Sonstiges
PDF-Vorlagen
Fragen und Antworten
Lieferantenbewertung
Dateiverwaltung
Auswertungen
Prozesse