GET /api/resources
Retrieve a list of all resources, documents, and reports related to Dzaleka Refugee Camp.Query Parameters
This endpoint does not require any query parameters.Response Format
Status of the API response (“success” or “error”)
Total number of resources returned
Container for the resources data
Array of resource objects
Unique identifier for the resource
Collection name (“resources”)
Resource title
Resource description
Publication or creation date (YYYY-MM-DD)
Resource category (e.g., “Situation Reports / Updates”, “Guidelines”, “Research”)
File type (e.g., “pdf”, “doc”, “xlsx”)
URL to view the resource online
Direct download URL
File size (e.g., “748.24 KB”, “2.5 MB”)
Last update date (YYYY-MM-DD)
Array of available languages
Whether the resource is featured
Author or publishing organization
Error Responses
“error”
Error message description
Detailed error information
200- Success429- 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 windowX-RateLimit-Remaining: Remaining requests in current windowX-RateLimit-Reset: Timestamp when the rate limit resetsRetry-After: Seconds to wait before retrying (only on 429 responses)
Example Request
Example Response
POST /api/resources
Retrieve resources data with optional metadata and statistics.Request Body
Response Format
Same as GET endpoint, with optional additional fields:Example Request
Example Response
Implementation
The Resources API is implemented using thecreateGetHandler and createPostHandler utility functions from src/utils/api-utils.ts:118.
Source code: src/pages/api/resources.ts:5