Objective-C Client library for the University of Waterloo Open Data API.
Drag the Xcode Project (UWaterlooAPIObjc.xcodeproj
) into your own project and then add the UWaterlooAPIObjc.framework
to the embedded binaries section in your target's settings.
To use the provided classes, #import <UWaterlooAPIObjc/UWaterlooAPIObjc.h>
.
Make sure to pass in a valid api key when initializing the client.
UWAPI* uwapi = [[UWAPI alloc] initWithApiKey:@"123456789"];
By default, responses will be in json format, but you can choose between json and xml.
UWAPI* uwapi = [[UWAPI alloc] initWithApiKey:@"123456789" andFormat:ResponseFormatXml];
All endpoints are accessed through the UWAPI instance's properties, and each property exposes the available methods for its respective endpoint. Handling the response is done through an (NSDictionary, NSError)
callback. The response is contained in the dictionary.
- Accessing the
/awards
endpoint through theawards
property to get a list of the available undergraduate scholarships:
[[uwapi awards] undergraduateAwardsWithCompletion:^(NSDictionary * _Nullable response, NSError * _Nullable error) {
// check for error
// if error is nil, do something with response
}];
- Acessing the
/courses
endpoint throught thecourse
property to get schedule for CS 246:
[[uwapi course] courseScheduleForSubject:@"CS" andCatalogNumber:@"246" withCompletion:^(NSDictionary * _Nullable response, NSError * _Nullable error) {
// check for error
// if error is nil, do something with response
}];
- Support for all endpoints.
- JSON and XML response formats.
uw-api-objc is licensed under the MIT License. See the LICENSE.md file for more information.
Waterloo OpenData is licensed under ODL (Open Data License) Agreement