UW Student Web Service
This implements most of the v5 UW Student Webservice endpoints. Each endpoint is querried for their json response and a hash is then returned. This gem has the capability to cache all web requests to assit with speedy development.
gem install uw_sws
First, configure the gem to how you want to use it.
require 'uw_sws' cert = "/TheFullPath/ToYour/x509Certificate.pem" key = "/TheFullPath/ToYour/x509Key" url = "https://ucswseval1.cac.washington.edu/student/v5/" service = UwSws.new(cert: cert, key: key, base: url, use_cache: false)
Now get all the Geology courses from 1985?
courses = service(1985, "winter", curriculum: "GEOG")
For cases where you need to page through results you can check for the existance
service.next and make follow up queries based on it's data.
courses = service.courses(1985, "autumn", curriculum: "GEOG", size: 25) puts service.next
For a full list of examples see
If you pass
use_cache: true as a parameter to
UwSws.new all web requests will be cached in your local file system. However, you will need to have a cache directory in the root of whatever projects you are using this gem in.
All links below go to the official service documentation. The code block refers to it's implementation in this gem. See the tests for how to use all the supported endpoints.
service = UwSws.new(...params...)
- College Search
- Course Search
- Curriculumn Search
- Department Search
- Enrollment Search
- Person Search
- Registration Search
- Section Search
- Test Score
Partially Supported (may or may not work)
Not implemented in this gem
Most of these are not implemented due to additional security requirements beyond a simple 509 cert. Requirements such as permissions in ASTRA or x-uw-act-as permissions passed in the header. Feel free fork and make a pull request with working tests if you have those permissions.
- Degree Audit (all of them) under review
- Change of Major extra security needed
- Enrollment Majors extra security needed
- Resource List not needed!
- Section Status extra security needed
- Version List not needed!
Ignore the cache warnings after bundle install.
git clone firstname.lastname@example.org:UWFosterIT/uwsws.git cd uwsws bundle install
Setup and Tests
cache symlink to point to a valid path or create a directory for it like below. Also, in
/test you will need to provide the full path to your x.509 cert and key before running
rm cache mkdir cache rake
You may get 1 or 2 test failing, "financial info", if that endpoint isn't in production yet. If something else fails it's most likely your cert or its permissions granted to it.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Changes Since < 2.0.0
- v4 is no longer used, all queries are now against v5
- no more public endpoints, all queries now require a cert
- Endpoints that ended with _search have been changed to their plural form (person_search to people)
- A few new endpoints were added, see list above for whats supported