Skip to content

Web service for accessing Bellevue College data in JSON format.

Notifications You must be signed in to change notification settings

BellevueCollege/data-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

266 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bellevue College Data API

The Data API is a RESTful, primarily read-only web service for accessing Bellevue College data in JSON format.

Documentation Endpoint 📚

  • docs/api - The documentation endpoint for the Data API (thanks to Scramble)

API Endpoints 🌐

Class/course data 🎓

  • api/v1/course/{CourseID} - Return course info for given course given the CourseID

  • api/v1/course/{Subject}/{CourseNumber} - Return course info for given course given the subject and course number

  • api/v1/courses/{Subject} - Return active courses for a given subject

  • api/v1/courses/multiple?courses[]={courseid}&courses[]={courseid}...

    • Uses courses[] query parameter in repeating fashion to specify multiple courses for which to have information returned.
  • api/v1/quarters - Return active/viewable quarters

  • api/v1/quarter/current - Returns the current quarter.

  • api/v1/quarter/{YearQuarterID}?format={strm oryrq } - Return info for the specified quarter. Defaults to lookup by YRQ. STRM can be used if format is set to strm.

  • api/v1/subjects - Return all subjects

  • api/v1/subjects?filter=active-credit" - Return only active, non-CE subjects

  • api/v1/subjects/{YearQuarterID} - Return subjects offered for specified quarter

  • api/v1/subject/{Subject} - Return subject info for given subject (slug)

  • api/v1/classes/{YearQuarterID}/{Subject} - Return course and class/section info offered given specified quarter and subject/department

  • api/v1/classes/{YearQuarterID}/{Subject}/{CourseNumber} - Return specific course and section/class info given a quarter, subject/department, and course number

Form Data ⌨️

Form Data endpoints are write-only, and accept POSTS with specific parameters and store the data for future reporting. Due to external requirements, they require HTTP Basic authentication using a Client ID and Client Key generated within the Admin interface.

  • api/v1/forms/pci/transactions - Accepts POST of transaction data (protected - HTTP Basic Auth)

Directory data 👩‍🎓👨‍🎓

  • api/v1/auth/login - The endpoint to authenticate and retrieve a valid token so protected data endpoints can be used. (protected)
  • api/v1/directory/employees - Return list of all employee usernames (protected)
  • api/v1/directory/employees/{part of name} - Return a list of employee usernames that match the provided substring of name (protected)
  • api/v1/directory/employee/{username} - Return employee directory information given a username (protected)

People data 👩‍🎓👨‍🎓 (🔒Internal Only)

  • api/v1/internal/auth/login - The endpoint to authenticate and retrieve a valid token so protected data endpoints can be used. (protected)
  • api/v1/internal/employee/{username} - Return basic employee information given a username (protected)
  • api/v1/internal/student/{username} - Return basic student information given a username (protected)

Transaction data (🔒)

  • api/v1/forms/pci/transaction - Record POSTed transaction data (protected)
  • api/v1/forms/pci/transaction/test - Don't Record (protected)

Admin Interface 👩‍💻 (🔒Internal Only)

There is a simple admin interface to allow creation and removal of API credentials. It is only available on the internal subdomain.

  • admin/login - Login interface (protected)

Terminology ℹ️

For explanation on terminology/objects used in the DataAPI, refer to the terminology documentation.

Development Environment

Data API uses Laravel Sail for a local development environment.

With Docker installed, run ./vendor/bin/sail up to build and start the VM.

Alternativly, you can use Podman instead of docker with some additional configuration; good info on this in this medium article

Once Sail informs you of the IP address it is using, add the following entries to your hosts file:

# Laravel Sail
0.0.0.0 data-api.test
0.0.0.0 no.data-api.test

To support SSL, you'll also need to generate a certificate and key.

openssl req -newkey rsa:2048 -nodes \
  -keyout docker/nginx/ssl/data-api.key \
  -x509 -days 365 \
  -out docker/nginx/ssl/data-api.crt \
  -subj "/CN=*.data-api.test"

Upgrade Considerations

When upgrading to a new version of PHP, the Dockerfile may need to be updated as well. Lines 28 and 46 of /docker/8.1/Dockerfile were added in order to add SQL Server support.

Build Status 🚀

Trunk Dev
Build status Build status

Configuration 🛠️

Azure Entra ID

Make sure to set the following environment variables:

  • AZURE_CLIENT_ID - The client ID of the Azure Entra ID application
  • AZURE_CLIENT_SECRET - The client secret of the Azure Entra ID application
  • AZURE_TENANT_ID - The tenant ID of the Azure Entra ID application
  • AZURE_REDIRECT_URI - The redirect URI of the Azure Entra ID application (e.g. https://no.data-api.test/admin/login/callback)

The BadgeZone 💫

emoji-log

About

Web service for accessing Bellevue College data in JSON format.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •