|
<< Click to Display Table of Contents >> Raynet One Data Hub > 2025.4 > Administration and User Guide > Advanced Topics > Data API Getting Table Data (Paged Query) |
This endpoints returns the data using paging. You can choose between the output format (CSV or JSON).
GET
http://[host]:[port]/v1/resultDatabase/<table-name>/paged
Parameter |
Required |
Description |
|---|---|---|
page |
No |
The number of the page to query. If omitted, the default value of 1 is taken (the first page). |
page_size |
No |
The number of rows returned per-page. When omitted, the default value of 1000 items per page is used. The maximum allowed value can be configured by administrators via the MaxBatchSize setting (see API Configuration). Exceeding this range or providing invalid values will coerce the value to the configured maximum. |
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). |
Accept |
Yes |
This determines the format of the data. Available supported values are:
application/json |
When the delta feature is enabled, you can use additional parameters to filter and retrieve data based on temporal criteria:
Example 1: Retrieve paged rows with metadata columns
http://[host]:[port]/v1/resultDatabase/<table-name>/paged?includeMetadata=true&page=1&page_size=100
Example 2: Retrieve paged rows created since a specific date
http://[host]:[port]/v1/resultDatabase/<table-name>/paged?includeMetadata=true&createdSince=2025-01-10T00:00:00&page=1&page_size=100
Example 3: Retrieve paged rows modified within a time span
http://[host]:[port]/v1/resultDatabase/<table-name>/paged?includeMetadata=true&updatedSince=2025-01-10T00:00:00&updatedUntil=2025-01-12T00:00:00&page=1&page_size=100
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 CatalogSoftware. It asks for the first page and returns 10 elements at once. Finally, it prints the column names with their types and the links for navigation:
$dataHubApiKey = "M6KNS9Z-3404R00-Q42E4SG-1G4HKWT"; $dataHubHostName = "https://datahub.local"; $dataHubPort = 443; $tableName = "CatalogSoftware"; $pageSize = 10; $page = 1;
$urlAddress = "{0}:{1}/v1/resultDatabase/table/{2}/paged?page={3}&page_size={4}" -f $dataHubHostName, $dataHubPort, $tableName, $page, $pageSize
$headers = @{}; $headers["ApiKey"] = $dataHubApiKey; $headers["Accept"] = "application/json";
$request = Invoke-WebRequest -Uri $urlAddress -Headers $headers -Method Get;
if ($request.StatusCode -eq 200) { $parsedContent = ConvertFrom-Json($request); Write-Host "Available columns:";
foreach ($item in $parsedContent.columns) { Write-Host (" * {0} ({1}) " -f $item.name, $item.type); } Write-Host "";
Write-Host "Number of records:"; Write-Host $parsedContent.records.Count; Write-Host "";
Write-Host "Pages": Write-Host (" * First: {0}" -f $parsedContent.pagination.first); Write-Host (" * Previous: {0}" -f $parsedContent.pagination.previous); Write-Host (" * Next: {0}" -f $parsedContent.pagination.next); Write-Host (" * Last: {0}" -f $parsedContent.pagination.last); } else { throw "Could not download the file. HTTP code $($req.StatusCode)"; } |
This prints the following: (Note: The output may be different depending on available tables)
Available columns:
* Id (String)
* SoftwareId (String)
* SoftwareVulnerabilityId (String)
* Status (String)
* VersionId (String)
* ProductId (String)
* Name (String)
* Vendor (String)
* RawVersion (String)
* Version (String)
* Architecture (String)
* Language (String)
* Website (String)
* ProductFamily (String)
* ParentFamily (String)
* Functionality (String)
* ReleaseDate (String)
* EndOfLifeDate (String)
* Support (String)
* SoftwareType (String)
* SoftwareClassification (String)
* License (String)
* AdditionalFunctions (String)
* LatestReleaseDate (String)
* LatestVersion (String)
Number of records:
10
Pages :
* First: https://datahub.local:443/v1/resultDatabase/resultTable/paged?tableName=Catalog_Software&page=1&page_size=10
* Previous:
* Next: https://datahub.local:443/v1/resultDatabase/resultTable/paged?tableName=Catalog_Software&page=2&page_size=10
* Last: https://datahub.local:443/v1/resultDatabase/resultTable/paged?tableName=Catalog_Software&page=233&page_size=10