Download the PHP package hkwu/uwapi-php without Composer
On this page you can find all versions of the php package hkwu/uwapi-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hkwu/uwapi-php
More information about hkwu/uwapi-php
Files in hkwu/uwapi-php
Package uwapi-php
Short Description PHP wrapper for the University of Waterloo's Open Data API.
License MIT
Homepage https://github.com/hkwu/uwapi-php
Informations about the package uwapi-php
uwapi-php
A PHP wrapper for the University of Waterloo's Open Data API supporting asynchronous requests through Guzzle.
This library requires PHP 7.0 or greater.
Installation
Install the client via Composer.
For global installations,
For local installations,
Usage
All request methods are wrapped inside the library's Client
class.
The configuration options the Client
constructor takes are listed below.
Option | Default | Description |
---|---|---|
key |
- | Your API access key. |
format |
'json' |
The format you wish the API response to be in. The Client provides these values as constants (e.g. Client::JSON ). |
async |
true |
True if requests should be made asynchronously. |
Making Requests
The Client
class comes with the request()
method for sending requests to the API.
You can send several requests all at once by using the batch()
method.
Accessing Response Data
Returned responses from the API are wrapped in data model classes. All data models provide the getRawData()
method, which returns the API response as a string.
The JSON (and by extension, GeoJSON) data models provide some additional convenience methods.
Endpoints
The library provides a number of constants to use when making requests. Most of these constants follow directly from the endpoints as provided in the API documentation, but a few have been tweaked to be more usable.
Constant | Value |
---|---|
FS_MENU |
'foodservices/menu' |
FS_NOTES |
'foodservices/notes' |
FS_DIETS |
'foodservices/diets' |
FS_OUTLETS |
'foodservices/outlets' |
FS_LOCATIONS |
'foodservices/locations' |
FS_WATCARD |
'foodservices/watcard' |
FS_ANNOUNCEMENTS |
'foodservices/announcements' |
FS_PRODUCTS_ID |
'foodservices/products/{product_id}' |
FS_YEAR_WEEK_MENU |
'foodservices/{year}/{week}/menu' |
FS_YEAR_WEEK_NOTES |
'foodservices/{year}/{week}/notes' |
FS_YEAR_WEEK_ANNOUNCEMENTS |
'foodservices/{year}/{week}/announcements' |
FEDS_EVENTS |
'feds/events' |
FEDS_EVENTS_ID |
'feds/events/{id}' |
FEDS_LOCATIONS |
'feds/locations' |
COURSES |
'courses' |
COURSES_SUBJECT |
'courses/{subject}' |
COURSES_ID |
'courses/{course_id}' |
COURSES_CLASS_SCHEDULE |
'courses/{class_number}/schedule' |
COURSES_SUBJECT_CATALOG |
'courses/{subject}/{catalog_number}' |
COURSES_SUBJECT_CATALOG_SCHEDULE |
'courses/{subject}/{catalog_number}/schedule' |
COURSES_SUBJECT_CATALOG_PREREQUISITES |
'courses/{subject}/{catalog_number}/prerequisites' |
COURSES_SUBJECT_CATALOG_EXAMSCHEDULE |
'courses/{subject}/{catalog_number}/examschedule' |
AWARDS_GRAD |
'awards/graduate' |
AWARDS_UNDERGRAD |
'awards/undergraduate' |
EVENTS |
'events' |
EVENTS_SITE |
'events/{site}' |
EVENTS_SITE_ID |
'events/{site}/{id}' |
EVENTS_HOLIDAYS |
'events/holidays' |
BLOGS_SITE |
'blogs/{site}' |
BLOGS_SITE_ID |
'blogs/{site}/{id}' |
NEWS |
'news' |
NEWS_SITE |
'news/{site}' |
NEWS_SITE_ID |
'news/{site}/{id}' |
OPPORTUNITIES |
'opportunities' |
OPPORTUNITIES_SITE |
'opportunities/{site}' |
OPPORTUNITIES_SITE_ID |
'opportunities/{site}/{id}' |
SERVICES_SITE |
'services/{site}' |
WEATHER_CURRENT |
'weather/current' |
TERMS_LIST |
'terms/list' |
TERMS_TERM_COURSES |
'terms/{term}/courses' |
TERMS_TERM_EXAMS |
'terms/{term}/examschedule' |
TERMS_TERM_SUBJECT_SCHEDULE |
'terms/{term}/{subject}/schedule' |
TERMS_TERM_SUBJECT_CATALOG_SCHEDULE |
'terms/{term}/{subject}/{catalog_number}/schedule' |
TERMS_TERM_ENROLLMENT |
'terms/{term}/enrollment' |
TERMS_TERM_SUBJECT_ENROLLMENT |
'terms/{term}/{subject}/enrollment' |
TERMS_TERM_INFOSESSIONS |
'terms/{term}/infosessions' |
RESOURCES_TUTORS |
'resources/tutors' |
RESOURCES_INFOSESSIONS |
'resources/infosessions' |
RESOURCES_GOOSEWATCH |
'resources/goosewatch' |
RESOURCES_SUNSHINELIST |
'resources/sunshinelist' |
CODES_UNITS |
'codes/units' |
CODES_TERMS |
'codes/terms' |
CODES_GROUPS |
'codes/groups' |
CODES_SUBJECTS |
'codes/subjects' |
CODES_INSTRUCTIONS |
'codes/instructions' |
BUILDINGS_LIST |
'buildings/list' |
BUILDINGS_CODE |
'buildings/{building_code}' |
BUILDINGS_BUILDING_ROOM_COURSES |
'buildings/{building}/{room}/courses' |
BUILDINGS_CODE_ACCESSPOINTS |
'buildings/{building_code}/accesspoints' |
BUILDINGS_CODE_VENDINGMACHINES |
'buildings/{building_code}/vendingmachines' |
POI_ATMS |
'poi/atms' |
POI_GREYHOUND |
'poi/greyhound' |
POI_HELPLINES |
'poi/helplines' |
POI_LIBRARIES |
'poi/libraries' |
POI_PHOTOSPHERES |
'poi/photospheres' |
POI_DEFIBRILLATORS |
'poi/defibrillators' |
POI_CONSTRUCTIONSITES |
'poi/constructionsites' |
POI_ACCESSIBLEENTRANCES |
'poi/accessibleentrances' |
POI_VISITORINFORMATION |
'poi/visitorinformation' |
PARKING_WATPARK |
'parking/watpark' |
PARKING_LOTS_METER |
'parking/lots/meter' |
PARKING_LOTS_PERMIT |
'parking/lots/permit' |
PARKING_LOTS_VISITOR |
'parking/lots/visitor' |
PARKING_LOTS_SHORTTERM |
'parking/lots/shortterm' |
PARKING_LOTS_ACCESSIBLE |
'parking/lots/accessible' |
PARKING_LOTS_MOTORCYCLE |
'parking/lots/motorcycle' |
TRANSIT_GRT |
'transit/grt' |
TRANSIT_GRT_STOPS |
'transit/grt/stops' |
DIRECTORY_ID |
'directory/{user_id}' |
API_USAGE |
'api/usage' |
API_SERVICES |
'api/services' |
API_METHODS |
'api/methods' |
API_VERSIONS |
'api/versions' |
API_CHANGELOG |
'api/changelog' |
SERVER_TIME |
'server/time' |
SERVER_CODES |
'server/codes' |
Contributing
Feel free to make pull requests for any changes.
Just a couple of things:
All versions of uwapi-php with dependencies
guzzlehttp/guzzle Version ^6.2
nicmart/string-template Version ^0.1.0
symfony/options-resolver Version ^3.1