Departments API
The Departments API provides access to the list of academic departments at Albion College. This endpoint is useful for retrieving department IDs that can be used with other API endpoints.
Endpoint
GET /api/data/departments
Authentication
All requests to this endpoint require authentication using an API key. You can provide your API key in one of the following ways:
- HTTP Header:
X-API-Key: your_api_key
- Bearer Token:
Authorization: Bearer your_api_key
- Query Parameter:
?apiKey=your_api_key
If you don’t have an API key, you can obtain one from your dashboard settings .
Response Format
The API returns a JSON response with the following structure:
{
"success": true,
"data": [
{
"id": 1,
"name": "Anthropology & Sociology"
},
{
"id": 2,
"name": "Art & Art History"
},
{
"id": 3,
"name": "Biology"
},
]
}
Response Fields
Field | Description |
---|---|
success | Boolean indicating if the request was successful |
data | Array of department objects |
data[].id | Unique identifier for the department |
data[].name | Name of the academic department |
Examples
Error Responses
Status Code | Description |
---|---|
401 | Authentication error (missing or invalid API key) |
500 | Server error |
Example error response:
{
"success": false,
"error": "API key missing",
"message": "Please provide an API key via X-API-Key header, Authorization: Bearer header, or apiKey query parameter.",
"docs": "https://docs.openalbion.org"
}