Verify that the API Gateway is operational
Replace the hostname test-01.example.com
, username seamrune
, and password Rad23Swops#
in the following request samples.
In Windows Command Prompt (CMD), replace the line continuation character \
with ^
.
-
Verify that you can get a list of well-known URIs from the API Gateway:
cURL
curl --insecure --request GET "https://test-01.example.com/api/.well-known/uris"
PowerShell
$response = Invoke-RestMethod 'https://test-01.example.com/api/.well-known/uris' -Method 'GET' $response | ConvertTo-Json
Response body
{ "ProductVersion": "22.1.5804.1", "UnsecureManagementServer": "http://test-01.example.com/", "SecureManagementServer": "https://test-01.example.com/", "IdentityProvider": "https://test-01.example.com/IDP", "ApiGateways": [ "https://test-01.example.com/API/" ] }
In case you had installed an API Gateway on another host, you could use the hostname of that host.
-
Verify that you can authenticate and retrieve a bearer token from the built-in IDP.
cURL
curl --insecure --request POST "https://test-01.example.com/api/idp/connect/token" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "grant_type=password" \ --data-urlencode "username=seamrune" \ --data-urlencode "password=Rad23Swops#" \ --data-urlencode "client_id=GrantValidatorClient"
PowerShell
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Content-Type", "application/x-www-form-urlencoded") $body = @{grant_type='password' username='seamrune' password='Rad23Swops#' client_id='GrantValidatorClient'} $response = Invoke-RestMethod 'https://test-01.example.com/api/idp/connect/token' ` -Method 'POST' -Headers $headers -Body $body $response | ConvertTo-Json
Response body
{ "access_token": "eyJhbG . . . YTWPjg", "expires_in": 3600, "token_type": "Bearer", "scope": "managementserver" }
Copy the
access_token
value from the response body; you will use the value as the bearer token value in the following request. -
Verify that you can submit a request through the API Gateway.
Replace the hostname
test-01.example.com
and the bearer token valueeyJhbG . . . YTWPjg
in the following request samples.cURL
curl --insecure --request GET "https://test-01.example.com/api/rest/v1/sites" \ --header "Authorization: Bearer eyJhbG . . . YTWPjg"
PowerShell
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]" $headers.Add("Authorization", "Bearer eyJhbG . . . YTWPjg") $response = Invoke-RestMethod 'https://test-01.example.com/api/rest/v1/sites' ` -Method 'GET' -Headers $headers $response | ConvertTo-Json
Response body
{ "array": [ { "displayName": "TEST-01", "id": "2d12465c-3485-4ca8-a9fb-86a79de1a82f", "name": "TEST-01", "description": "", "lastModified": "2021-11-11T11:11:11.1111111Z", "timeZone": "Central Europe Time", "computerName": "TEST-01", "domainName": "example.com", "lastStatusHandshake": "2021-11-11T11:11:11.1111111Z", "physicalMemory": 0, "platform": "[Not Available]", "processors": 0, "serviceAccount": "S-1-5-20", "synchronizationStatus": 0, "masterSiteAddress": "", "version": "21.2.0.1", "relations": { "self": { "type": "sites", "id": "2d12465c-3485-4ca8-a9fb-86a79de1a82f" } } } ] }