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:

  1. Go to Settings > API
  2. Click "Generate API Key"
  3. Copy and securely store your key
  4. Review API documentation

Never share your API key publicly!

Authentication

Authenticate requests:

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Include 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:

  1. Configure webhook URLs in Settings
  2. Select events to monitor:
  3. - Inspection completed
  4. - Report generated
  5. - Client portal accessed
  6. - Payment received
  1. 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!