GET /api/services
Retrieve a list of all services and organizations available in Dzaleka Refugee Camp.
Query Parameters
This endpoint does not require any query parameters.
Status of the API response (“success” or “error”)
Total number of services returned
Container for the services dataArray of service objectsUnique identifier for the service
Collection name (“services”)
Name of the service or organization
Service category (e.g., “Education”, “Legal Services”, “Technology”)
Detailed description of the service
Physical location information Whether the service is featured
Whether the service is verified
Last update date (YYYY-MM-DD)
Error Responses
Error message description
Detailed error information
Status Codes:
200 - Success
429 - Rate limit exceeded (60 requests per minute)
500 - Internal server error
Rate Limiting
All API endpoints are rate-limited to 60 requests per minute per IP address. Rate limit headers are included in responses:
X-RateLimit-Limit: Maximum requests per window
X-RateLimit-Remaining: Remaining requests in current window
X-RateLimit-Reset: Timestamp when the rate limit resets
Retry-After: Seconds to wait before retrying (only on 429 responses)
Example Request
curl -X GET "https://services.dzaleka.com/api/services" \
-H "Content-Type: application/json"
Example Response
{
"status": "success",
"count": 2,
"data": {
"services": [
{
"id": "BloomBox",
"collection": "services",
"title": "BloomBox Design Labs",
"category": "Education",
"description": "BloomBox Design Labs is dedicated to the application of sustainable design strategies, materials, and energy to advancing access to high quality education.",
"location": {
"address": "BloomBox, Dzaleka, M16",
"city": "Dowa",
"coordinates": {
"lat": -13.6628274,
"lng": 33.8704301
}
},
"contact": {
"email": "",
"phone": "+1 236-888-5055",
"hours": "Monday-Friday, 9:00 AM - 5:00 PM"
},
"socialMedia": {
"facebook": "",
"twitter": "https://x.com/roux_sofie",
"instagram": "https://www.instagram.com/bloomboxdesignlabs/?hl=en",
"linkedin": "",
"website": "https://www.bloomboxdesignlabs.com/"
},
"logo": "https://static.wixstatic.com/media/bd2625_69e11c70797246ccba3425b1b8bcd771%7Emv2.png/v1/fill/w_192%2Ch_192%2Clg_1%2Cusm_0.66_1.00_0.01/bd2625_69e11c70797246ccba3425b1b8bcd771%7Emv2.png",
"featured": true,
"verified": true,
"lastUpdated": "2025-03-06"
}
]
}
}
POST /api/services
Retrieve services data with optional metadata and statistics.
Request Body
Optional configuration for the responseInclude export metadata in response
Include statistics in response
Same as GET endpoint, with optional additional fields:
Export metadata (only if includeMetadata: true)ISO 8601 timestamp of export
Statistics (only if includeStats: true)
Example Request
curl -X POST "https://services.dzaleka.com/api/services" \
-H "Content-Type: application/json" \
-d '{
"options": {
"includeMetadata": true,
"includeStats": true
}
}'
Example Response
{
"status": "success",
"count": 45,
"data": {
"services": [
{
"id": "BloomBox",
"title": "BloomBox Design Labs",
"category": "Education"
}
]
},
"metadata": {
"exportDate": "2025-03-09T12:00:00.000Z",
"collection": "services"
},
"stats": {
"totalItems": 45,
"collection": "services"
}
}
Implementation
The Services API is implemented using the createGetHandler and createPostHandler utility functions from src/utils/api-utils.ts:118.
Source code: src/pages/api/services.ts:5