Ping Endpoints
Health monitoring and connectivity testing for the Actions API.
Overview
Ping endpoints provide a simple way to test connectivity and validate authentication with the mindzieAPI. These endpoints are essential for monitoring system health and troubleshooting connection issues.
Unauthorized Ping
GET /api/{tenantId}/{projectId}/action/unauthorized-ping
Basic connectivity test that does not require authentication. Use this to verify the API is accessible.
Request
GET https://your-mindzie-instance.com/api/{tenantId}/{projectId}/action/unauthorized-ping
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tenantId |
GUID | Yes | Your tenant identifier |
projectId |
GUID | Yes | Your project identifier |
Response
HTTP/1.1 200 OK
Content-Type: text/plain
Ping Successful
Use Cases
- Basic connectivity testing
- Load balancer health checks
- Network troubleshooting
- Service availability monitoring
Authenticated Ping
GET /api/{tenantId}/{projectId}/action/ping
Authenticated connectivity test that validates credentials and verifies access to the specified tenant and project.
Request
GET https://your-mindzie-instance.com/api/{tenantId}/{projectId}/action/ping
Authorization: Bearer {your-access-token}
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
tenantId |
GUID | Yes | Your tenant identifier |
projectId |
GUID | Yes | Your project identifier |
Response
Success (200 OK):
HTTP/1.1 200 OK
Content-Type: text/plain
Ping Successful (tenant id: 12345678-1234-1234-1234-123456789012)
Unauthorized (401):
HTTP/1.1 401 Unauthorized
Content-Type: text/plain
{error message describing authorization failure}
Use Cases
- Authentication validation
- Permission verification
- Token validity testing
- Tenant/project access validation
Implementation Examples
cURL
# Unauthorized ping
curl -X GET "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/action/unauthorized-ping"
# Authenticated ping
curl -X GET "https://your-mindzie-instance.com/api/12345678-1234-1234-1234-123456789012/87654321-4321-4321-4321-210987654321/action/ping" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
JavaScript/Node.js
const TENANT_ID = '12345678-1234-1234-1234-123456789012';
const PROJECT_ID = '87654321-4321-4321-4321-210987654321';
const BASE_URL = 'https://your-mindzie-instance.com';
// Unauthorized ping
const unauthorizedPing = async () => {
const response = await fetch(
`${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/action/unauthorized-ping`
);
const text = await response.text();
console.log('Unauthorized ping:', text);
return response.ok;
};
// Authenticated ping
const authenticatedPing = async (token) => {
const response = await fetch(
`${BASE_URL}/api/${TENANT_ID}/${PROJECT_ID}/action/ping`,
{
headers: {
'Authorization': `Bearer ${token}`
}
}
);
if (response.ok) {
const text = await response.text();
console.log('Authenticated ping:', text);
return true;
} else {
console.error('Authentication failed:', response.status);
return false;
}
};
Python
import requests
TENANT_ID = '12345678-1234-1234-1234-123456789012'
PROJECT_ID = '87654321-4321-4321-4321-210987654321'
BASE_URL = 'https://your-mindzie-instance.com'
def unauthorized_ping():
"""Basic connectivity test without authentication."""
url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/action/unauthorized-ping'
response = requests.get(url)
print(f'Unauthorized ping: {response.text}')
return response.ok
def authenticated_ping(token):
"""Authenticated connectivity test."""
url = f'{BASE_URL}/api/{TENANT_ID}/{PROJECT_ID}/action/ping'
headers = {
'Authorization': f'Bearer {token}'
}
response = requests.get(url, headers=headers)
if response.ok:
print(f'Authenticated ping: {response.text}')
return True
else:
print(f'Authentication failed: {response.status_code}')
return False
C#
using System.Net.Http;
using System.Threading.Tasks;
public class ActionApiClient
{
private readonly HttpClient _httpClient;
private readonly string _baseUrl;
private readonly Guid _tenantId;
private readonly Guid _projectId;
public ActionApiClient(string baseUrl, Guid tenantId, Guid projectId, string accessToken)
{
_baseUrl = baseUrl;
_tenantId = tenantId;
_projectId = projectId;
_httpClient = new HttpClient();
_httpClient.DefaultRequestHeaders.Authorization =
new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", accessToken);
}
public async Task<bool> UnauthorizedPingAsync()
{
var url = $"{_baseUrl}/api/{_tenantId}/{_projectId}/action/unauthorized-ping";
var response = await _httpClient.GetAsync(url);
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine($"Unauthorized ping: {content}");
return response.IsSuccessStatusCode;
}
public async Task<bool> AuthenticatedPingAsync()
{
var url = $"{_baseUrl}/api/{_tenantId}/{_projectId}/action/ping";
var response = await _httpClient.GetAsync(url);
var content = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode)
{
Console.WriteLine($"Authenticated ping: {content}");
return true;
}
else
{
Console.WriteLine($"Authentication failed: {response.StatusCode}");
return false;
}
}
}
Best Practices
- Health Checks: Use the unauthorized ping for automated health monitoring systems
- Pre-flight Validation: Call authenticated ping before executing actions to validate credentials
- Error Handling: Always handle network timeouts and authentication failures gracefully
- Monitoring: Set up automated alerts based on ping failures to detect service outages early