/
Server API List

Server API List

This document contains a list of APIs you can revoke with the getApiData() and postApiData() functions.

Other Documents

VarsityGames

Returns a list of varsity games between the start and end date. 

Parameters:

  • start (string): the starting date of the list of varsity games. The format of the date is 'YYYY-MM-DD'.

  • end (string): the end date of the list of varsity games. The format of the date is 'YYYY-MM-DD'.

Example:

portalHelpers.getApiData('Athletics/VarsityGames?start=2017-10-01&end=2017-10-31').then(function (result) {
    console.log("result", result);
});

GetAwards

Return a list of Awards. You can specify whether to get grad or undergrad awards.

Parameter:

  • isGrad (bool): specify whether to get grad or undergrad awards.

Example:

portalHelpers.getApiData('Awards/GetAwards?isGrad=' + ($rootScope.user.Career == "GRD" ? 'true' : 'false')).then(function (result) {
    console.log("result", result);
});

GetBlogPostsMultiple

Gets blog posts from multiple sources. This function is called from the web. By default, this function returns blogs within 120 days. The max number of returned blogs is 200.

Parameters:

  • slug (Dictionary<string, string[]>): specify the blog sources from which you want to get blogs.

  • days: specify the date range of the returned blogs. The default is return blogs posted in 120 days.
  • limit: specify the maximum number of the returned blog posts. The default is 200. 

Example:

portalHelpers.postApiData('Blogs/GetBlogPostsMultiple', { sources: "['about','news','student-success']" }).then(function (result) {
    console.log("result", result);
});


GetBlogPost

Gets details of the specified blog post.

Parameters:

  • slug (string): specify the blog source from which you want to get the blog post.

  • id(int): specify the ID of the blog post you want to get.

Example:

portalHelpers.getApiData('blogs/GetBlogPost?slug=student-success&id=11935).then(function (result) {
    console.log("result", result);
});

MyEvents

Get events of the user from all sources, such as intramural, exams, classes, important dates, icals, on a specified day.

Parameter:

  • start (string): specify the date to get events.

Example:

portalHelpers.getApiData('Calendar/MyEvents?start=2017-10-01').then(function (result) {
    console.log("result", result);
});

PortalCalendar

Get events from a portal calendar within a specified range.

Parameters:

  • name (string): specify the name of the calendar.

  • start (string): specify the starting date of the range.
  • end(string): specify the end date of the range.

Example:

portalHelpers.getApiData('Calendar/PortalCalendar?name=Portal Calendar&start=2017-10-01&end=2017-10-20').then(function (result) {
    console.log("result", result);
});

CustomEvents

Gets all custom event information of the current user and return the information in a list of CustomEvent.

Parameter:

  • name (string): specify the name of the calendar. The default value is "Portal Calendar"

Example:

portalHelpers.getApiData('Calendar/CustomEvents?name=Portal Calendar).then(function (result) {
    console.log("result", result);
});

RemoteIcalFeed

Imports an iCal feed into the Portal Calendar. If the iCal feed is from Portal, this function does not import the feed and returns null.

Parameters:

  • url (string): specify the name of the calendar.

  • start (string): specify the starting date of the range.
  • end (string): specify the end date of the range.
  • ignoreTime (bool): specify whether to include events that start on the end date.

Example:

portalHelpers.getApiData('Calendar/RemoteIcalFeed?name=Portal Calendar).then(function (result) {
    console.log("result", result);
});

NonScience

Returns information of computer labs that do not belong to the science department.

Example:

portalHelpers.getApiData('ComputerLabs/NonScience').then(function (result) {
    console.log("result", result);
});

Science

Returns all computer labs that belong to Science.

Example:

portalHelpers.getApiData('ComputerLabs/NonScience').then(function (result) {
    console.log("result", result);
});

GetEmptyClassRooms

Returns empty classrooms for the specified building.

Parameter:

  • building (string): specify the building name.

Example:

portalHelpers.getApiData('EmptyClassrooms/GetEmptyClassRooms?building=AL').then(function (result) {
    console.log("result", result);
});

BuildingCodes

Returns a list of building codes from the Portal database.

Example:

portalHelpers.getApiData('EmptyClassrooms/BuildingCodes').then(function (result) {
    console.log("result", result);
});

MyEvents

Returns a list of events from the specified sources. 

Parameter:

  • sources(Dictionary<string, string[]>): specify the building name.

Example:

portalHelpers.postApiData('events/myEvents', { sources: "['arts||0:1:2:3:4:5:6:7:8:9','chemical-engineering||0:1:2:3:4:5:6:7:8:9']"}).then(function (result) {
    console.log("result", result);
});

GetCecaWorkshopEvents

Returns a list of CECA workshop events within a range.

Parameters:

  • startDate (datetime): specify the starting date of the range.

  • endDate (datetime): specify the end date of the range.

Example:

portalHelpers.getApiData('Events/GetCecaWorkshopEvents?startDate=2017-10-01&endDate=2017-10-20').then(function (result) {
    console.log("result", result);
});

Details

Returns details of an event through open data.

Parameters:

  • site (string): specify the site of the event.

  • id (string): specify the id of the event.

Example:

portalHelpers.getApiData('Events/details?site=library&id=1252').then(function (result) {
    console.log("result", result);
});

MySchedule

Returns a list of exams for the current user.

Example:

portalHelpers.getApiData('exams/myschedule').then(function (result) {
    console.log("result", result);
});

GetInfo

Returns a list of food locations and a list of menus for today.

Parameter:

  • includeMenus (bool): specify whether to return menu information of food locations.

Example:

portalHelpers.getApiData('food/GetInfo').then(function (result) {
    console.log("result", result);
});

GetFoodLocationInfo

Gets a list of food locations through open data.

Example:

portalHelpers.getApiData('food/GetFoodLocationInfo').then(function (result) {
    console.log("result", result);
});

GetMenuInfoForDate

Gets menus on a specified day through open data.

Parameter:

  • date (DateTime): specify the date for the request.

Example:

portalHelpers.getApiData('food/GetMenuInfoForDate?date=2017-10-12').then(function (result) {
    console.log("result", result);
});

GetNutritionForProduct

Gets the nutrition information for the specified product through open data.

Parameter:

  • product_id (int): specify the ID of the product.

Example:

portalHelpers.getApiData('food/GetNutritionForProduct?id=1364').then(function (result) {
    console.log("result", result);
});

Dates

Returns a list of upcoming important dates for the current user.

Example:

portalHelpers.getApiData('importantDates/dates').then(function (result) {
    console.log("result", result);
});

AllDates

Gets all important dates for the current user through open data. This function do not filter important dates by time.

Example:

portalHelpers.getApiData('importantDates/AllDates').then(function (result) {
    console.log("result", result);
});

GetNetworkAndServiceAlertsData

Returns the status of IST services and the last updated time.

Example:

portalHelpers.getApiData('networkAndServiceAlerts/GetNetworkAndServiceAlertsData').then(function (result) {
    console.log("result", result);
});

GetNetworkAndServiceAlertsDetails

Gets details of a specified IST service.

Parameter:

  • source (string): specify the name of the service.

Example:

portalHelpers.getApiData('networkAndServiceAlerts/GetNetworkAndServiceAlertsDetails?source=CAS').then(function (result) {
    console.log("result", result);
});

GetFullTextForSerivceDetail

Returns the full text details of a network and service alert from the database. 

Parameter:

  • tickedId (string): specify the name of the service.

Example:

portalHelpers.getApiData('networkAndServiceAlerts/GetFullTextForSerivceDetail?tickedId=1304').then(function (result) {
    console.log("result", result);
});

GetNewsForSources

Returns news from the specifed news sources in Json. This function returns news within 14 days only.

Parameter:

  • sources (Dictionary<string, string[]>): specify the news sources.

Example:

portalHelpers.postApiData('news/GetNewsForSources', { source: "['viewbook','events','housing']" }).then(function (result) {
    console.log("result", result);
});

GetWCMSNews

Gets news from the specified WCMS website within the start and end dates.

Parameters:

  • startDate (string): specify start date of the range. (TODO: the start and end are reversed in the code. Need to fix.)

  • endDate (string): specify end date of the range.
  • site (string): specify the source of the news.
  • friendlyName (string): specify a friendly name for the news source.

Example:

portalHelpers.getApiData('news/GetWCMSNews?startDate=2017-10-30T00:00:00.0000000-04:00&endDate=2017-09-01T00:00:00.0000000-04:00&site=news&friendlyName=Waterloo+News').then(function (result) {
    console.log("result", result);
});

GetNewsDetails

Gets details of a news item from a WCMS website.

Parameters:

  • site (string): specify the source of the news.

  • id (string): specify the ID of the news item.

Example:

portalHelpers.getApiData('news/GetNewsDetails?site=news&id=3072').then(function (result) {
    console.log("result", result);
});

GetUserNotifications

Returns a list of notifications for the current user. The list also contains notification for the faculty and career group that this user belongs.

Example:

portalHelpers.getApiData('notifications/GetUserNotifications').then(function (result) {
    console.log("result", result);
});

MarkNotificationAsRead

Marks a notification item as read.

Parameter:

  • notifId (int): specify the ID of a notification.

Example:

portalHelpers.getApiData('notifications/MarkNotificationAsRead?notifId=' + notifId).then(function (result) {
    console.log("result", result);
});

MarkNotificationAsUnRead

Marks a notification item as read.

Parameter:

  • notifId (int): specify the ID of a notification.

Example:

portalHelpers.getApiData('notifications/MarkNotificationAsUnRead?notifId=' + notifId).then(function (result) {
    console.log("result", result);
});

MarkNotificationAsDismissed

Marks a notification item as dismissed.

Parameter:

  • notifId (int): specify the ID of a notification.

Example:

portalHelpers.getApiData('notifications/MarkNotificationAsDismissed?notifId=' + notifId).then(function (result) {
    console.log("result", result);
});

MarkNotificationAsSeen

Marks a notification item as seen.

Parameter:

  • notifId (int): specify the ID of a notification.

Example:

portalHelpers.getApiData('notifications/MarkNotificationAsSeen?notifId=' + notifId).then(function (result) {
    console.log("result", result);
});

MarkNotificationAsLinked

Marks a notification item as linked.

Parameter:

  • notifId (int): specify the ID of a notification.

Example:

portalHelpers.getApiData('notifications/MarkNotificationAsLinked?notifId=' + notifId).then(function (result) {
    console.log("result", result);
});

GetOffCampusHousingListings

Gets a list of off campus housing options.

Example:

portalHelpers.getApiData('OCH/GetOffCampusHousingListings').then(function (result) {
    console.log("result", result);
});

Feds

Gets a list of available FEDS opportunities.

Example:

portalHelpers.getApiData('opportunities/feds').then(function (result) {
    console.log("result", result);
});

GetParkingLotInfo

Gets the parking lot information through open data.

Example:

portalHelpers.getApiData('Parking/GetParkingLotInfo').then(function (result) {
    console.log("result", result);
});

MyTutors

Gets a list of tutors for the enrolled classes of the user.

Example:

portalHelpers.getApiData('resources/myTutors').then(function (result) {
    console.log("result", result);
});

AllTutors 

Gets a list of all available tutors from open data.

Example:

portalHelpers.getApiData('resources/AllTutors ').then(function (result) {
    console.log("result", result);
});

SubjectLibrarians

Gets a list of subject librarians.

Example:

portalHelpers.getApiData('resources/subjectLibrarians').then(function (result) {
    console.log("result", result);
});

CourseMaterials

Gets all course materials for all enrolled courses of the user.

Example:

portalHelpers.getApiData('resources/CourseMaterials').then(function (result) {
    console.log("result", result);
});

TermDetails

Gets the detailed information of all terms.

Example:

portalHelpers.getApiData('student/TermDetails').then(function (result) {
    console.log("result", result);
});

Bio2

Gets the ID, username, and full name of the current user.

Example:

portalHelpers.getApiData('student/Bio2').then(function (result) {
    console.log("result", result);
});

Terms2

Gets the terms information of the current user.

Example:

portalHelpers.getApiData('student/Terms2').then(function (result) {
    console.log("result", result);
});

Courses2

Gets the current enrolled courses information of the current user.

Example:

portalHelpers.getApiData('student/Courses2').then(function (result) {
    console.log("result", result);
});

CurrentTermCode

Returns the current term code.

Example:

portalHelpers.getApiData('student/CurrentTermCode').then(function (result) {
    console.log("result", result);
});

Instructors

Returns instructors of the current enrolled courses of the user.

Example:

portalHelpers.getApiData('student/Instructors').then(function (result) {
    console.log("result", result);
});

Meets2

Returns class meets of the current enrolled courses of the user.

Example:

portalHelpers.getApiData('student/Meets2').then(function (result) {
    console.log("result", result);
});

NonScheduledClasses

Gets a list of non-scheduled course meets in terms within the specified start and end dates.

Parameters:

  • start (string): specify the start date.

  • end (string): specify the end date.

Example:

portalHelpers.getApiData('student/NonScheduledClasses?start=2017-09-01&end=2017-10-30').then(function (result) {
    console.log("result", result);
});

OnlineCourses

Gets a list of online courses for the current student in terms within the start and end dates.

Parameters:

  • start (string): specify the start date.

  • end (string): specify the end date.

Example:

portalHelpers.getApiData('student/OnlineCourses?start=2017-09-01&end=2017-10-30').then(function (result) {
    console.log("result", result);
});

CollegeAffiliations

Gets college affiliations of the current student.

Example:

portalHelpers.getApiData('student/CollegeAffiliations').then(function (result) {
    console.log("result", result);
});

RezInfo

Gets resident data of the current student.

Example:

portalHelpers.getApiData('student/RezInfo').then(function (result) {
    console.log("result", result);
});

GetStudySpacesToday

Gets all study spaces that are available today.

Example:

portalHelpers.getApiData('StudySpace/GetStudySpacesToday').then(function (result) {
    console.log("result", result);
});

GetFedBusSchedule

Gets Fed Bus schedule from the Fed Bus website.

Example:

portalHelpers.getApiData('Transportation/GetFedBusSchedule').then(function (result) {
    console.log("result", result);
});

GetGoTransitStopInfo

Gets Go Bus stops information from the Go Transit website.

Example:

portalHelpers.getApiData('Transportation/GetGoTransitStopInfo').then(function (result) {
    console.log("result", result);
});

GetUserInfo

Gets user information for the current user.

Example:

portalHelpers.getApiData('User/GetUserInfo').then(function (result) {
    console.log("result", result);
});

GetAllWcmsSites

Gets a list of all WCMS websites.

Example:

portalHelpers.getApiData('WCMS/GetAllWcmsSites').then(function (result) {
    console.log("result", result);
});

ForecastIo

Fetches weather forcast information from the API of darksky.net.

Parameter:

  • campus (string): specify the campus for which you want to get weather information.

Example:

portalHelpers.getApiData('Weather/ForecastIo?campus=waterloo').then(function (result) {
    console.log("result", result);
});

Current

Retrieves current weather information from the forcast information.

Parameter:

  • campus (string): specify the campus for which you want to get weather information.

Example:

portalHelpers.getApiData('Weather/Current?campus=waterloo').then(function (result) {
    console.log("result", result);
});

Forecast

Retrieves hourly and daily forcast information.

Parameter:

  • campus (string): specify the campus for which you want to get weather information.

Example:

portalHelpers.getApiData('Weather/Forecast?campus=waterloo').then(function (result) {
    console.log("result", result);
});

Alerts

Fetches weather alerts from RSS.

Example:

portalHelpers.getApiData('Weather/Alerts').then(function (result) {
    console.log("result", result);
});

Related content