Quick health check: verify your API key is valid and Orchestra is reachable with a single GET request. Use this before troubleshooting integration issues.
Validate that your API key is correctly configured and the Orchestra API is reachable.
Endpoint: GET /Utils/apiKey
Validate Your Key
const response = await fetch('https://api.orchestrasolutions.com/Utils/apiKey', {
headers: {
'X-Api-Key': 'YOUR_API_KEY'
}
});
if (response.ok) {
const result = await response.json();
console.log('API key valid:', result);
} else {
console.error('Invalid API key');
}
Response
{
"status": "OK",
"userName": "your-username",
"accountId": 12345,
"isSandbox": false
}
Response Fields
| Field | Type | Description |
|---|
status | string | OK if key is valid |
userName | string | Username associated with the key |
accountId | integer | Your Orchestra account ID |
isSandbox | boolean | true for test keys, false for production |
Use Cases
Health Check
Include in your application’s startup or health check routine:
async function checkOrchestraConnection() {
try {
const response = await fetch('https://api.orchestrasolutions.com/Utils/apiKey', {
headers: { 'X-Api-Key': process.env.ORCHESTRA_API_KEY }
});
if (!response.ok) {
throw new Error('Invalid Orchestra API key');
}
const { isSandbox } = await response.json();
console.log(`Orchestra connected (${isSandbox ? 'sandbox' : 'production'})`);
return true;
} catch (error) {
console.error('Orchestra connection failed:', error.message);
return false;
}
}
Environment Verification
Confirm you’re using the correct key for your environment:
const result = await response.json();
if (process.env.NODE_ENV === 'production' && result.isSandbox) {
console.warn('Warning: Using sandbox API key in production!');
}
Response Codes
| Code | Description |
|---|
200 | API key is valid |
401 | Invalid or missing API key |