Skip to Content
API EndpointsDepartments

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

FieldDescription
successBoolean indicating if the request was successful
dataArray of department objects
data[].idUnique identifier for the department
data[].nameName of the academic department

Examples

Get All Departments

curl -X GET "https://openalbion.org/api/data/departments" \ -H "X-API-Key: your_api_key"

Error Responses

Status CodeDescription
401Authentication error (missing or invalid API key)
500Server 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" }