|
<< Click to Display Table of Contents >> Raynet One Data Hub > 2025.4 > Administration and User Guide > Advanced Topics > Data API Getting Table Data (All Rows) |
This is the simplest way of querying the data.
GET
http://[host]:[port]/v1/resultDatabase/table/<table-name>
Parameter |
Required |
Description |
|---|---|---|
includeDataTypes |
No (default: true) |
This parameter is only relevant for CSV file requests.
If set to false, then the CSV will receive an extra token after the header name, which contains the desired value type, enclosed by square brackets.
If you omit this parameter or set it to true, the returned CSV will not have this extra information, and the CSV column names will be a 1-1 representation of the column names. |
includeMetadata |
No (default: false) |
Delta Feature Only: When set to true, includes metadata columns (__dh_created_at, __dh_last_modified, __dh_md5_checksum). This parameter is only available when the backup & delta feature is enabled for the tenant. See Delta Comparison Feature for more information. |
createdSince |
No |
Delta Feature Only: Retrieve only rows created on or after the specified timestamp. Format: ISO 8601 (e.g., "2025-01-15T10:30:00Z"). Can be combined with createdUntil to define a time span. Only available when delta feature is enabled. |
createdUntil |
No |
Delta Feature Only: Retrieve only rows created before or on the specified timestamp. Format: ISO 8601 (e.g., "2025-01-31T23:59:59Z"). Only available when delta feature is enabled. |
updatedSince |
No |
Delta Feature Only: Retrieve only rows updated on or after the specified timestamp. Format: ISO 8601 (e.g., "2025-01-15T10:30:00Z"). Can be combined with updatedUntil to define a time span. Only available when delta feature is enabled. |
updatedUntil |
No |
Delta Feature Only: Retrieve only rows updated before or on the specified timestamp. Format: ISO 8601 (e.g., "2025-01-31T23:59:59Z"). Only available when delta feature is enabled. |
Parameter |
Required |
Description |
|---|---|---|
ApiKey |
Yes |
Your API key (see chapter Authentication and authorization for more information how to get it). |
When the delta feature is enabled, you can use additional parameters to filter and retrieve data based on temporal criteria:
Example 1: Retrieve rows with metadata columns
http://[host]:[port]/v1/resultDatabase/table/<table-name>?includeMetadata=true
Example 2: Retrieve rows created since a specific date
http://[host]:[port]/v1/resultDatabase/table/<table-name>?includeMetadata=true&createdSince=2025-01-10T00:00:00
Example 3: Retrieve rows modified within a time span
http://[host]:[port]/v1/resultDatabase/table/<table-name>?includeMetadata=true&updatedSince=2025-01-10T00:00:00&updatedUntil=2025-01-12T00:00:00
The following code connects to the instance https://datahahub.local (using SSL and port 443) with authentication token M6KNS9Z-3404R00-Q42E4SG-1G4HKWT and then reads the content of the table Catalog_Software, which then gets written to local file c:\temp\results.csv. Note: The output may be different depending on available tables
$dataHubApiKey = "M6KNS9Z-3404R00-Q42E4SG-1G4HKWT"; $dataHubHostName = "https://datahub.local"; $dataHubPort = 443;
$tableName = "CatalogSoftware"; $outFile = "C:\temp\results.csv";
$urlAddress = "{0}:{1}/v1/resultDatabase/table/{2}" -f $dataHubHostName, $dataHubPort, $tableName
$headers = @{}; $headers["ApiKey"] = $dataHubApiKey;
$request = Invoke-WebRequest -Uri $urlAddress -Headers $headers -Method Get;
if ($request.StatusCode -eq 200) { Write-Host $request.Content; $request.Content | Out-File $outFile } else { throw "Could not list the tables. HTTP code {0}" -f $request.StatusCode; } |