API Playground

Welcome to the PulseGuard API Playground! This interactive environment allows you to test and explore our API endpoints directly from the documentation.

Features

🚀 Interactive Testing

  • Test all API endpoints directly from your browser
  • Real-time request/response inspection
  • Automatic code generation in multiple languages
  • Live schema validation

🔧 Code Examples

Our playground automatically generates code examples in:
  • cURL - Command line testing
  • Python - Using requests library
  • JavaScript - Fetch API and axios
  • PHP - Guzzle HTTP client

🛡️ Authentication

The playground supports all PulseGuard authentication methods:
  • Bearer Token - For standard API access
  • Agent Token - For device communications
  • Public Endpoints - No authentication required

Getting Started

1. Obtain Your API Token

  1. Log into your PulseGuard Dashboard
  2. Navigate to SettingsAPI Tokens
  3. Generate a new token with appropriate permissions
  4. Copy the token for use in the playground

2. Configure Authentication

In any API endpoint playground:
  1. Click the 🔒 Authorize button
  2. Enter your API token in the format: Bearer YOUR_TOKEN
  3. Click Authorize to apply to all requests

3. Test Endpoints

  1. Navigate to any endpoint in the API Reference
  2. Fill in required parameters
  3. Click Try it out
  4. View the response and generated code

Quick Start Examples

Domain Monitoring

# List all domains
curl -X GET "https://app.pulseguard.nl/api/v1/domains" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Create a new domain monitor
curl -X POST "https://app.pulseguard.nl/api/v1/domains" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Website",
    "url": "https://example.com",
    "check_interval": 5
  }'

Device Management

# Get device metrics
curl -X GET "https://app.pulseguard.nl/api/v1/devices/DEVICE-UUID" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

# Regenerate device token
curl -X POST "https://app.pulseguard.nl/api/v1/devices/DEVICE-UUID/regenerate-token" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Toolbox Utilities

# DNS lookup
curl -X POST "https://app.pulseguard.nl/api/v1/toolbox/dns-lookup" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "record_type": "A"
  }'

# SSL certificate check
curl -X POST "https://app.pulseguard.nl/api/v1/toolbox/ssl-check" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com"
  }'

Response Format

All API responses follow a consistent format:
{
  "success": true,
  "message": "Operation completed successfully",
  "data": {
    // Response data here
  }
}

Error Responses

{
  "success": false,
  "message": "Error description",
  "errors": {
    "field_name": ["Validation error message"]
  }
}

Rate Limiting

The playground respects all rate limits:
PlanRequests/MinuteRequests/Hour
Expert1,00010,000
Pro3003,000
Free1001,000
Rate limit information is shown in response headers:
  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset

Best Practices

🔒 Security

  • Never expose API tokens in client-side code
  • Use environment variables for token storage
  • Rotate tokens regularly
  • Use minimum required permissions

⚡ Performance

  • Cache frequently accessed data
  • Use appropriate pagination parameters
  • Batch requests when possible
  • Implement exponential backoff for retries

🐛 Error Handling

  • Always check the success field in responses
  • Handle rate limit errors gracefully
  • Log errors for debugging
  • Implement proper timeout handling

Troubleshooting

Common Issues

401 Unauthorized
  • Check your API token is valid
  • Ensure token has required permissions
  • Verify Expert Plan subscription for API access
403 Forbidden
  • Upgrade to required subscription plan
  • Check endpoint-specific plan requirements
  • Verify token permissions
422 Validation Error
  • Review request payload format
  • Check required fields are present
  • Validate data types and formats
429 Rate Limit Exceeded
  • Implement exponential backoff
  • Consider upgrading your plan
  • Optimize request frequency

Getting Help


Ready to start testing? Head over to our API Reference and try out the interactive playground!