Getting Available Table Names

<< Click to Display Table of Contents >>

Raynet One Data Hub > 14.0 > Administration and User Guide > Advanced Topics > Data API 

Getting Available Table Names

This REST endpoint returns the list of available tables in JSON format.

 

Type of Request

GET

 

Endpoint URL

http://[host]:[port]/v1/resultDatabase/table

 

Query Parameters

This request has no configurable parameters.

 

Headers

Parameter

Required

Description

ApiKey

Yes

Your API key (see chapter Authentication and authorization for more information how to get it).

 

Sample (PowerShell)

The following code connects to the instance https://datahahub (using SSL and port 443) with authentication token VG1N2TN-SRG40PH-HET38HP-HX3BPQ6 and then reads the names of available tables.

 

$dataHubApiKey = "M6KNS9Z-3404R00-Q42E4SG-1G4HKWT";

$dataHubHostName = "https://datahub.local";

$dataHubPort = 443;

 

$urlAddress = "{0}:{1}/v1/resultDatabase/table" -$dataHubHostName,$dataHubPort

 

$headers = @{};

$headers["ApiKey"] = $dataHubApiKey;

 

$request = Invoke-WebRequest -Uri $urlAddress -Headers $headers -Method Get;

 

if ($request.StatusCode -eq 200)

{

    Write-Host "Available table names:";

    Write-Host (ConvertFrom-Json($request.Content));

} else {

    throw "Could not list the tables. HTTP code {0}" -$request.StatusCode;

}

 

This prints the following (Note: The output may be different depending on available tables)

 

Available table names:

Catalog_Software CustomTask MergedDevices