Advanced8 min read
API Integration
Integrate BN Reports with external systems using our REST API, webhooks, and detailed documentation.
# API Integration
Integrate BN Reports with your existing systems using our powerful REST API.
Getting Started
Access the API:
- Go to Settings > API
- Click "Generate API Key"
- Copy and securely store your key
- Review API documentation
Never share your API key publicly!
Authentication
Authenticate requests:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/jsonInclude these headers in all API requests.
Available Endpoints
Core functionality:
- Inspections:
- GET /api/inspections - List all inspections
- POST /api/inspections - Create new inspection
- GET /api/inspections/{id} - Get specific inspection
- PUT /api/inspections/{id} - Update inspection
- DELETE /api/inspections/{id} - Delete inspection
- Clients:
- GET /api/clients - List all clients
- POST /api/clients - Create new client
- GET /api/clients/{id} - Get specific client
- PUT /api/clients/{id} - Update client
- Reports:
- POST /api/reports/generate - Generate PDF report
- GET /api/reports/{id} - Download report
Webhooks
Real-time notifications:
- Configure webhook URLs in Settings
- Select events to monitor:
- - Inspection completed
- - Report generated
- - Client portal accessed
- - Payment received
- Receive POST requests with event data
Common Use Cases
Integration examples:
- CRM Integration:
- Sync clients automatically
- Update contact records
- Track inspection history
- Accounting Software:
- Create invoices on completion
- Track payments
- Generate financial reports
- Marketing Automation:
- Trigger email campaigns
- Update lead status
- Track conversion metrics
- Custom Apps:
- Build mobile apps
- Create dashboards
- Automate workflows
Rate Limits
API usage limits:
- Standard: 100 requests/minute
- Professional: 500 requests/minute
- Enterprise: Unlimited
Error Handling
Handle errors gracefully:
{
"error": {
"code": "INVALID_REQUEST",
"message": "Missing required field: client_id",
"details": {}
}
}- Common error codes:
- 400: Bad Request
- 401: Unauthorized
- 404: Not Found
- 429: Rate Limit Exceeded
- 500: Server Error
Best Practices
Optimize API usage:
- Cache responses when appropriate
- Use pagination for large datasets
- Implement exponential backoff for retries
- Monitor rate limit headers
- Keep API keys secure
Code Examples
Sample integration:
// Create new inspection
const response = await fetch('https://api.bnreports.com/v1/inspections', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
client_id: '123',
property_address: '123 Main St',
inspection_date: '2025-01-15'
})
});const data = await response.json();
console.log(data);
`
API Documentation
Access full docs:
- Interactive API explorer
- Code samples in multiple languages
- Detailed parameter descriptions
- Response schema documentation
Visit: [api.bnreports.com/docs](https://api.bnreports.com/docs)
Support
Need help?
- API documentation: api.bnreports.com/docs
- Developer forum: community.bnreports.com
- Email support: api@bnreports.com
- Priority support for Enterprise plans
Build powerful integrations!