API Documentation

Complete API reference for BloodLink Africa. Build powerful integrations with our RESTful API.

Quick Start
1

Get your API key

Generate an API key from your account settings

2

Authenticate requests

Include your API key in the Authorization header

3

Make your first request

Start with the /api/users/profile endpoint

Authentication

BloodLink Africa uses Bearer token authentication. Include your API key in the Authorization header.

Authorization: Bearer YOUR_API_KEY
Rate Limiting

API requests are rate limited to ensure fair usage and system stability.

Free Tier
100 requests/hour
Pro Tier
1000 requests/hour

API Endpoints

POST
/api/auth/login
Authentication

Authenticate user and get access token

View Details
GET
/api/users/profile
Users

Get current user profile information

View Details
POST
/api/blood-requests
Blood Requests

Create a new blood donation request

View Details
GET
/api/blood-requests
Blood Requests

Get list of blood donation requests

View Details
POST
/api/donations
Donations

Record a blood donation

View Details
GET
/api/analytics/dashboard
Analytics

Get dashboard analytics data

View Details

Code Examples

javascript
// Authentication
const response = await fetch('/api/auth/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'password123'
  })
});

const data = await response.json();
const token = data.access_token;

// Using the token for authenticated requests
const profileResponse = await fetch('/api/users/profile', {
  headers: {
    'Authorization': `Bearer ${token}`
  }
});
API Testing Console

Security Notice

Never expose your API keys in client-side code. Always use server-side authentication for production applications.

Need Help?

Get support from our developer community or contact our technical team.