Get a working custom platform that validates connectivity to a REST API over HTTP in under 5 minutes.
A minimal platform script that sends an HTTP request to an API endpoint to verify that the system is reachable and credentials are valid.
Download or copy TemplateHttpMinimal.json and rename it (e.g., MyApiCheck.json).
Open the file and update the CheckSystem operation to hit your API's health or authentication endpoint. For example, if your API uses Basic Auth:
"CheckSystem": {
"Parameters": [
{ "Address": { "Type": "String", "Required": true } },
{ "FuncUserName": { "Type": "String", "Required": true } },
{ "FuncPassword": { "Type": "Secret", "Required": true } }
],
"Do": [
{ "BaseAddress": { "Address": "https://%Address%" } },
{ "NewHttpRequest": { "ObjectName": "HealthReq" } },
{ "HttpAuth": { "RequestObjectName": "HealthReq", "Type": "Basic", "Credentials": { "Login": "%FuncUserName%", "Password": "%FuncPassword%" } } },
{ "Request": { "RequestObjectName": "HealthReq", "ResponseObjectName": "HealthResp", "Verb": "GET", "Url": "/api/v1/health" } },
{
"Condition": {
"If": "HealthResp.StatusCode != 200",
"Then": { "Do": [{ "Throw": { "Value": "System check failed: HTTP %{HealthResp.StatusCode}%" } }] }
}
},
{ "Return": { "Value": true } }
]
}Replace /api/v1/health with your target's actual endpoint. If the request succeeds (HTTP 200), the script returns true. Without an explicit Return, SPP treats the result as a failed check even when the API responds successfully.
# Create a new custom platform with the script
New-SafeguardCustomPlatform -Name "MyApiCheck" -ScriptFile .\MyApiCheck.json
# To update an existing platform's script later:
# Import-SafeguardCustomPlatformScript -PlatformToEdit "MyApiCheck" -ScriptFile .\MyApiCheck.json- In the SPP web UI, go to Asset Management > Assets > Add
- Set the platform to your new custom platform
- Set the network address to the API hostname
- Assign a service account with API credentials (username/password or token)
Test-SafeguardAsset -AssetToTest "MyApiServer" -ExtendedLoggingIf it reports success, SPP can reach your API.
- Add
CheckPasswordandChangePassword— see Your First HTTP Script - Learn about HTTP authentication patterns — see HTTP Platforms Guide
- Study a production-ready sample — see WordPress HTTP