Integration IssuesSetup & Connection Problems
Resolve API connection problems, authentication errors, and integration challenges with step-by-step solutions and code examples.
Common Integration Problems
Most frequent issues and how to fix them
API Key Not Working
Symptoms
- 401 Unauthorized errors
- Authentication failed messages
- Invalid API key responses
Solutions
- Verify you're using the correct API key for your environment (test vs. production)
- Check that the API key is active in your dashboard
- Ensure the key is being sent in the Authorization header as 'Bearer YOUR_KEY'
- Generate a new API key if the current one may be compromised
Code Example
// Correct API key usage
const response = await fetch('https://api.dailyevent.com/v1/policies', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
});CORS Errors
Symptoms
- Access-Control-Allow-Origin errors
- Blocked by CORS policy messages
- Preflight request failures
Solutions
- Add your domain to the allowed origins in your dashboard settings
- Ensure requests include proper CORS headers
- Use server-side API calls for sensitive operations
- For widget integration, verify the domain whitelist
Code Example
// Backend proxy to avoid CORS (recommended)
app.post('/api/insurance', async (req, res) => {
const response = await fetch('https://api.dailyevent.com/v1/policies', {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.DAILY_EVENT_API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify(req.body)
});
const data = await response.json();
res.json(data);
});Webhook Not Receiving Events
Symptoms
- No webhook deliveries in logs
- Events not triggering callbacks
- Webhook endpoint not being called
Solutions
- Verify webhook URL is publicly accessible (not localhost)
- Check that your endpoint accepts POST requests
- Ensure SSL certificate is valid
- Review webhook logs in your dashboard for delivery attempts
- Verify webhook signature validation is correct
Code Example
// Webhook endpoint example
app.post('/webhooks/insurance', (req, res) => {
const signature = req.headers['x-dailyevent-signature'];
// Verify webhook signature
const isValid = verifySignature(req.body, signature, WEBHOOK_SECRET);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
const event = req.body;
// Process event
switch (event.type) {
case 'policy.created':
// Handle policy creation
break;
case 'claim.submitted':
// Handle claim submission
break;
}
res.status(200).send('OK');
});Rate Limiting
Symptoms
- 429 Too Many Requests errors
- Rate limit exceeded messages
- Temporary blocks on API calls
Solutions
- Implement exponential backoff retry logic
- Cache responses where appropriate
- Batch API calls when possible
- Monitor your rate limit usage in the dashboard
- Contact support for higher rate limits if needed
Code Example
// Rate limit handling with exponential backoff
async function callApiWithRetry(url, options, maxRetries = 3) {
for (let i = 0; i < maxRetries; i++) {
try {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = response.headers.get('Retry-After') || (Math.pow(2, i) * 1000);
await new Promise(resolve => setTimeout(resolve, retryAfter));
continue;
}
return response;
} catch (error) {
if (i === maxRetries - 1) throw error;
}
}
}Proper Integration Setup
Follow these steps to avoid common integration issues
Generate API Keys
Log into your dashboard and navigate to Settings > API Keys. Generate separate keys for test and production environments. Store keys securely in environment variables.
Configure Webhooks
Set up webhook endpoints in your dashboard. Provide a publicly accessible HTTPS URL. Select which events you want to receive. Save the webhook secret for signature verification.
Whitelist Domains
Add your domains to the allowed list in dashboard settings. Include all subdomains that will make API calls. Configure CORS settings for frontend integrations.
Test Integration
Use test API keys to verify your integration works correctly. Test all endpoints you'll be using. Verify webhook delivery. Check error handling before going live.