BambooHR Debug Bundle
Overview
Collect all diagnostic information for BambooHR API troubleshooting or support tickets. Captures connectivity tests, API response details, environment info, and redacted configuration.
Prerequisites
- BambooHR environment variables set
curl available for API tests
- Permission to collect environment info
Instructions
Step 1: Complete Debug Bundle Script
#!/bin/bash
# bamboohr-debug-bundle.sh — Run this, then send the .tar.gz to support
set -euo pipefail
BUNDLE_DIR="bamboohr-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
DOMAIN="${BAMBOOHR_COMPANY_DOMAIN:?Set BAMBOOHR_COMPANY_DOMAIN}"
API_KEY="${BAMBOOHR_API_KEY:?Set BAMBOOHR_API_KEY}"
BASE="https://api.bamboohr.com/api/gateway.php/${DOMAIN}/v1"
exec > >(tee "$BUNDLE_DIR/summary.txt") 2>&1
echo "=== BambooHR Debug Bundle ==="
echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "Company Domain: ${DOMAIN}"
echo "API Key: ${API_KEY:0:4}****${API_KEY: -4}"
echo ""
# ── Environment ──────────────────────────────────────
echo "--- Runtime Environment ---"
echo "Node.js: $(node --version 2>/dev/null || echo 'not installed')"
echo "npm: $(npm --version 2>/dev/null || echo 'not installed')"
echo "Python: $(python3 --version 2>/dev/null || echo 'not installed')"
echo "curl: $(curl --version 2>/dev/null | head -1)"
echo "OS: $(uname -a)"
echo ""
# ── API Connectivity Test ────────────────────────────
echo "--- API Connectivity ---"
echo -n "Directory endpoint: "
curl -s -o "$BUNDLE_DIR/directory-response.json" \
-w "HTTP %{http_code} | %{time_total}s | %{size_download} bytes\n" \
-u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/employees/directory"
echo -n "Employee endpoint: "
curl -s -o "$BUNDLE_DIR/employee-response.json" \
-w "HTTP %{http_code} | %{time_total}s | %{size_download} bytes\n" \
-u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/employees/0/?fields=firstName"
echo -n "Time off types: "
curl -s -o "$BUNDLE_DIR/timeoff-types-response.json" \
-w "HTTP %{http_code} | %{time_total}s\n" \
-u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/meta/time_off/types"
echo ""
# ── Response Headers (verbose for one endpoint) ─────
echo "--- Response Headers (directory) ---"
curl -s -I -u "${API_KEY}:x" \
-H "Accept: application/json" \
"${BASE}/employees/directory" \
| grep -iE "^(x-bamboohr|content-type|retry-after|date|server)" \
> "$BUNDLE_DIR/response-headers.txt"
cat "$BUNDLE_DIR/response-headers.txt"
echo ""
# ── Project Dependencies ─────────────────────────────
echo "--- Project Dependencies ---"
if [ -f package.json ]; then
node -e "
const pkg = require('./package.json');
const deps = {...pkg.dependencies, ...pkg.devDependencies};
const bamboo = Object.entries(deps).filter(([k]) => k.includes('bamboo'));
const http = Object.entries(deps).filter(([k]) => ['axios','node-fetch','got','ky'].includes(k));
console.log('BambooHR packages:', bamboo.length ? bamboo.map(([k,v]) => k+'@'+v).join(', ') : 'none (using fetch)');
console.log('HTTP clients:', http.length ? http.map(([k,v]) => k+'@'+v).join(', ') : 'native fetch');
" 2>/dev/null || echo "Could not parse package.json"
fi
echo ""
# ── Configuration (redacted) ─────────────────────────
echo "--- Configuration (redacted) ---"
if [ -f .env ]; then
sed 's/=.*/=***REDACTED***/' .env > "$BUNDLE_DIR/config-redacted.txt"
echo "Found .env with $(wc -l < .env) lines"
else
echo "No .env file found"
fi
# ── Redact sensitive data from API responses ─────────
for f in "$BUNDLE_DIR"/*-response.json; do
if [ -f "$f" ]; then
# Remove email addresses and phone numbers from responses
sed -i 's/[a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]*/***@redacted/g' "$f"
sed -i 's/[0-9]\{3\}[-. ][0-9]\{3\}[-. ][0-9]\{4\}/***-***-****/g' "$f"
fi
done
echo ""
echo "--- Bundle Complete ---"
# ── Package ──────────────────────────────────────────
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
echo "Created: $BUNDLE_DIR.tar.gz ($(du -h "$BUNDLE_DIR.tar.gz" | cut -f1))"
echo ""
echo "BEFORE SHARING: Review $BUNDLE_DIR/ for any remaining PII"
Step 2: Programmatic Debug Info (TypeScript)
import { BambooHRClient, BambooHRApiError } from './bamboohr/client';
interface DiagnosticResult {
timestamp: string;
environment: Record<string, string>;
connectivity: {
endpoint: string;
status: number;
latencyMs: number;
error?: string;
}[];
}
async function collectDiagnostics(client: BambooHRClient): Promise<DiagnosticResult> {
const endpoints = [
'/employees/directory',
'/meta/time_off/types',
'/meta/lists/',
];
const connectivity = await Promise.all(
endpoints.map(async (endpoint) => {
const start = Date.now();
try {
await client.request('GET', endpoint);
return { endpoint, status: 200, latencyMs: Date.now() - start };
} catch (err) {
const status = err instanceof BambooHRApiError ? err.status : 0;
return {
endpoint, status, latencyMs: Date.now() - start,
error: (err as Error).message,
};
}
}),
);
return {
timestamp: new Date().toISOString(),
environment: {
nodeVersion: process.version,
platform: process.platform,
companyDomain: process.env.BAMBOOHR_COMPANY_DOMAIN || 'NOT SET',
apiKeySet: process.env.BAMBOOHR_API_KEY ? 'yes' : 'NO',
},
connectivity,
};
}
Output
bamboohr-debug-YYYYMMDD-HHMMSS.tar.gz archive containing:
summary.txt — Environment, connectivity, and dependency info
directory-response.json — Redacted API response sample
response-headers.txt — BambooHR-specific headers
config-redacted.txt — Environment config with secrets removed
Sensitive Data Handling
Always redact before sharing:
- API keys and tokens
- Employee emails, phone numbers, SSNs
- Home addresses and personal info
- Salary and compensation data
Safe to include:
- HTTP status codes and error messages
- Response latencies and sizes
X-BambooHR-Error-Message header values
- SDK/runtime versions
Error Handling
| Issue |
Cause |
Solution |
| curl not found |
Not installed |
Install curl or use Node.js version |
| Permission denied |
Script not executable |
chmod +x bamboohr-debug-bundle.sh |
| Empty response files |
Auth failure |
Check API key before running |
| Large bundle size |
Too many response files |
Reduce to key endpoints only |
Resources
Next Steps
For rate limit issues, see bamboohr-rate-limits.
1---2name: bamboohr-debug-bundle3description: |4 Collect BambooHR debug evidence for support tickets and troubleshooting.5 Use when encountering persistent issues, preparing support tickets,6 or collecting diagnostic information for BambooHR API problems.7 Trigger with phrases like "bamboohr debug", "bamboohr support bundle",8 "collect bamboohr logs", "bamboohr diagnostic", "bamboohr troubleshoot".9allowed-tools: Read, Bash(curl:*), Bash(tar:*), Bash(node:*), Grep10version: 1.0.011license: MIT12author: Jeremy Longshore <jeremy@intentsolutions.io>13tags: [saas, hr, bamboohr, debugging]14compatible-with: claude-code15---1617# BambooHR Debug Bundle1819## Overview2021Collect all diagnostic information for BambooHR API troubleshooting or support tickets. Captures connectivity tests, API response details, environment info, and redacted configuration.2223## Prerequisites2425- BambooHR environment variables set26- `curl` available for API tests27- Permission to collect environment info2829## Instructions3031### Step 1: Complete Debug Bundle Script3233```bash34#!/bin/bash35# bamboohr-debug-bundle.sh — Run this, then send the .tar.gz to support3637set -euo pipefail3839BUNDLE_DIR="bamboohr-debug-$(date +%Y%m%d-%H%M%S)"40mkdir -p "$BUNDLE_DIR"4142DOMAIN="${BAMBOOHR_COMPANY_DOMAIN:?Set BAMBOOHR_COMPANY_DOMAIN}"43API_KEY="${BAMBOOHR_API_KEY:?Set BAMBOOHR_API_KEY}"44BASE="https://api.bamboohr.com/api/gateway.php/${DOMAIN}/v1"4546exec > >(tee "$BUNDLE_DIR/summary.txt") 2>&14748echo "=== BambooHR Debug Bundle ==="49echo "Generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"50echo "Company Domain: ${DOMAIN}"51echo "API Key: ${API_KEY:0:4}****${API_KEY: -4}"52echo ""5354# ── Environment ──────────────────────────────────────55echo "--- Runtime Environment ---"56echo "Node.js: $(node --version 2>/dev/null || echo 'not installed')"57echo "npm: $(npm --version 2>/dev/null || echo 'not installed')"58echo "Python: $(python3 --version 2>/dev/null || echo 'not installed')"59echo "curl: $(curl --version 2>/dev/null | head -1)"60echo "OS: $(uname -a)"61echo ""6263# ── API Connectivity Test ────────────────────────────64echo "--- API Connectivity ---"65echo -n "Directory endpoint: "66curl -s -o "$BUNDLE_DIR/directory-response.json" \67 -w "HTTP %{http_code} | %{time_total}s | %{size_download} bytes\n" \68 -u "${API_KEY}:x" \69 -H "Accept: application/json" \70 "${BASE}/employees/directory"7172echo -n "Employee endpoint: "73curl -s -o "$BUNDLE_DIR/employee-response.json" \74 -w "HTTP %{http_code} | %{time_total}s | %{size_download} bytes\n" \75 -u "${API_KEY}:x" \76 -H "Accept: application/json" \77 "${BASE}/employees/0/?fields=firstName"7879echo -n "Time off types: "80curl -s -o "$BUNDLE_DIR/timeoff-types-response.json" \81 -w "HTTP %{http_code} | %{time_total}s\n" \82 -u "${API_KEY}:x" \83 -H "Accept: application/json" \84 "${BASE}/meta/time_off/types"8586echo ""8788# ── Response Headers (verbose for one endpoint) ─────89echo "--- Response Headers (directory) ---"90curl -s -I -u "${API_KEY}:x" \91 -H "Accept: application/json" \92 "${BASE}/employees/directory" \93 | grep -iE "^(x-bamboohr|content-type|retry-after|date|server)" \94 > "$BUNDLE_DIR/response-headers.txt"95cat "$BUNDLE_DIR/response-headers.txt"96echo ""9798# ── Project Dependencies ─────────────────────────────99echo "--- Project Dependencies ---"100if [ -f package.json ]; then101 node -e "102 const pkg = require('./package.json');103 const deps = {...pkg.dependencies, ...pkg.devDependencies};104 const bamboo = Object.entries(deps).filter(([k]) => k.includes('bamboo'));105 const http = Object.entries(deps).filter(([k]) => ['axios','node-fetch','got','ky'].includes(k));106 console.log('BambooHR packages:', bamboo.length ? bamboo.map(([k,v]) => k+'@'+v).join(', ') : 'none (using fetch)');107 console.log('HTTP clients:', http.length ? http.map(([k,v]) => k+'@'+v).join(', ') : 'native fetch');108 " 2>/dev/null || echo "Could not parse package.json"109fi110echo ""111112# ── Configuration (redacted) ─────────────────────────113echo "--- Configuration (redacted) ---"114if [ -f .env ]; then115 sed 's/=.*/=***REDACTED***/' .env > "$BUNDLE_DIR/config-redacted.txt"116 echo "Found .env with $(wc -l < .env) lines"117else118 echo "No .env file found"119fi120121# ── Redact sensitive data from API responses ─────────122for f in "$BUNDLE_DIR"/*-response.json; do123 if [ -f "$f" ]; then124 # Remove email addresses and phone numbers from responses125 sed -i 's/[a-zA-Z0-9._%+-]*@[a-zA-Z0-9.-]*/***@redacted/g' "$f"126 sed -i 's/[0-9]\{3\}[-. ][0-9]\{3\}[-. ][0-9]\{4\}/***-***-****/g' "$f"127 fi128done129130echo ""131echo "--- Bundle Complete ---"132133# ── Package ──────────────────────────────────────────134tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"135echo "Created: $BUNDLE_DIR.tar.gz ($(du -h "$BUNDLE_DIR.tar.gz" | cut -f1))"136echo ""137echo "BEFORE SHARING: Review $BUNDLE_DIR/ for any remaining PII"138```139140### Step 2: Programmatic Debug Info (TypeScript)141142```typescript143import { BambooHRClient, BambooHRApiError } from './bamboohr/client';144145interface DiagnosticResult {146 timestamp: string;147 environment: Record<string, string>;148 connectivity: {149 endpoint: string;150 status: number;151 latencyMs: number;152 error?: string;153 }[];154}155156async function collectDiagnostics(client: BambooHRClient): Promise<DiagnosticResult> {157 const endpoints = [158 '/employees/directory',159 '/meta/time_off/types',160 '/meta/lists/',161 ];162163 const connectivity = await Promise.all(164 endpoints.map(async (endpoint) => {165 const start = Date.now();166 try {167 await client.request('GET', endpoint);168 return { endpoint, status: 200, latencyMs: Date.now() - start };169 } catch (err) {170 const status = err instanceof BambooHRApiError ? err.status : 0;171 return {172 endpoint, status, latencyMs: Date.now() - start,173 error: (err as Error).message,174 };175 }176 }),177 );178179 return {180 timestamp: new Date().toISOString(),181 environment: {182 nodeVersion: process.version,183 platform: process.platform,184 companyDomain: process.env.BAMBOOHR_COMPANY_DOMAIN || 'NOT SET',185 apiKeySet: process.env.BAMBOOHR_API_KEY ? 'yes' : 'NO',186 },187 connectivity,188 };189}190```191192## Output193194- `bamboohr-debug-YYYYMMDD-HHMMSS.tar.gz` archive containing:195 - `summary.txt` — Environment, connectivity, and dependency info196 - `directory-response.json` — Redacted API response sample197 - `response-headers.txt` — BambooHR-specific headers198 - `config-redacted.txt` — Environment config with secrets removed199200## Sensitive Data Handling201202**Always redact before sharing:**203- API keys and tokens204- Employee emails, phone numbers, SSNs205- Home addresses and personal info206- Salary and compensation data207208**Safe to include:**209- HTTP status codes and error messages210- Response latencies and sizes211- `X-BambooHR-Error-Message` header values212- SDK/runtime versions213214## Error Handling215216| Issue | Cause | Solution |217|-------|-------|----------|218| curl not found | Not installed | Install curl or use Node.js version |219| Permission denied | Script not executable | `chmod +x bamboohr-debug-bundle.sh` |220| Empty response files | Auth failure | Check API key before running |221| Large bundle size | Too many response files | Reduce to key endpoints only |222223## Resources224225- [BambooHR Support](https://www.bamboohr.com/contact-support/)226- [BambooHR Status Page](https://status.bamboohr.com)227228## Next Steps229230For rate limit issues, see `bamboohr-rate-limits`.231