JavaScript client for the UCL API.
See the main UCL API Documentation at https://uclapi.com/docs.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 1.4.11
- Package version: 1.4.11
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
For Node.js
Install the SDK through npm via:
npm install @uclapi/sdk --save
If you want to use the SDK via this GitHub repository, then install it via:
npm install uclapi/uclapi-js-sdk --save
The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify
, perform the following (assuming index.js is your entry file, that's to say your JavaScript file where you actually use this library):
browserify index.js > bundle.js
Then include bundle.js in your HTML pages.
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Please follow the installation instruction and execute the following JS code:
const uclapi = require('@uclapi/sdk');
const api = new uclapi.AnalyticsApi()
const opts = {
'service': "service_example" // {String} The service to check the popularity of methods for
};
const callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ', data);
}
};
api.dashboardApiAnalyticsMethodsGet(opts, callback);
See more detailed examples at the uclapi-openapi
repository.
All URIs are relative to https://uclapi.com
Class | Method | HTTP request | Description |
---|---|---|---|
uclapi.AnalyticsApi | dashboardApiAnalyticsMethodsGet | GET /dashboard/api/analytics/methods | Gets all methods for a given service and their popularity |
uclapi.AnalyticsApi | dashboardApiAnalyticsOauthTotalByDeptGet | GET /dashboard/api/analytics/oauth/total_by_dept | Gets the total number of users for a given app token, by department |
uclapi.AnalyticsApi | dashboardApiAnalyticsOauthTotalGet | GET /dashboard/api/analytics/oauth/total | Gets the total number of users for a given app token |
uclapi.AnalyticsApi | dashboardApiAnalyticsQuotaGet | GET /dashboard/api/analytics/quota | Gets the remaining daily quota for a given token |
uclapi.AnalyticsApi | dashboardApiAnalyticsServicesGet | GET /dashboard/api/analytics/services | Gets all services and their popularity |
uclapi.AnalyticsApi | dashboardApiAnalyticsTotalGet | GET /dashboard/api/analytics/total | Gets the total number of requests made from a given token |
uclapi.LibCalApi | libcalSpaceBookingsGet | GET /libcal/space/bookings | Get all LibCal bookings |
uclapi.LibCalApi | libcalSpaceCancelPost | POST /libcal/space/cancel | Cancel one or more LibCal bookings |
uclapi.LibCalApi | libcalSpaceCategoriesGet | GET /libcal/space/categories | Returns the categories of spaces available in the given location(s) |
uclapi.LibCalApi | libcalSpaceCategoryGet | GET /libcal/space/category | Get all spaces corresponding to the specified categories |
uclapi.LibCalApi | libcalSpaceFormGet | GET /libcal/space/form | Get all forms (including fields) corresponding to the given LibCal form ID(s) |
uclapi.LibCalApi | libcalSpaceItemGet | GET /libcal/space/item | Get the spaces corresponding to the given LibCal space ID(s) |
uclapi.LibCalApi | libcalSpaceLocationsGet | GET /libcal/space/locations | Gets all LibCal locations |
uclapi.LibCalApi | libcalSpaceNicknameGet | GET /libcal/space/nickname | Get the nicknames asssigned to certain LibCal bookings |
uclapi.LibCalApi | libcalSpacePersonalBookingsGet | GET /libcal/space/personal_bookings | Get all LibCal bookings |
uclapi.LibCalApi | libcalSpaceQuestionGet | GET /libcal/space/question | Get the questions corresponding to the given LibCal field/question ID(s) |
uclapi.LibCalApi | libcalSpaceReservePost | POST /libcal/space/reserve | Reserve one or more LibCal spaces/seats |
uclapi.LibCalApi | libcalSpaceSeatGet | GET /libcal/space/seat | Get LibCal seat by ID |
uclapi.LibCalApi | libcalSpaceSeatsGet | GET /libcal/space/seats | Get all LibCal seats in a given location |
uclapi.LibCalApi | libcalSpaceUtilizationGet | GET /libcal/space/utilization | Get utilisation stats for a particular location |
uclapi.LibCalApi | libcalSpaceZoneGet | GET /libcal/space/zone | Get LibCal zone by ID |
uclapi.LibCalApi | libcalSpaceZonesGet | GET /libcal/space/zones | Get LibCal zones by location |
uclapi.OAuthApi | oauthAuthoriseGet | GET /oauth/authorise | Authorises a user against the API |
uclapi.OAuthApi | oauthTokenGet | GET /oauth/token | A token will be generated which your app can use to get user’s personal data in JSON format from the OAuthSecurity/user/data. |
uclapi.OAuthApi | oauthUserDataGet | GET /oauth/user/data | Returns personal data on a student at UCL. |
uclapi.OAuthApi | oauthUserStudentnumberGet | GET /oauth/user/studentnumber | You can use the oauth/user/data endpoint to find out whether the user is a student before you call this endpoint. If you call this endpoint and the user is not a student, an error will be returned. |
uclapi.ResourcesApi | resourcesDesktopsGet | GET /resources/desktops | Returns number of desktops and how many are free at the time of making the request. |
uclapi.RoomBookingsApi | roombookingsBookingsGet | GET /roombookings/bookings | Returns the results to a bookings or space availability query. It returns a paginated list of bookings. |
uclapi.RoomBookingsApi | roombookingsEquipmentGet | GET /roombookings/equipment | Returns any equipment/feature information about a specific room. |
uclapi.RoomBookingsApi | roombookingsFreeroomsGet | GET /roombookings/freerooms | Given a start time and an end time, this endpoint returns all rooms which are free in that time range. |
uclapi.RoomBookingsApi | roombookingsRoomsGet | GET /roombookings/rooms | Returns rooms and information about them. |
uclapi.SearchApi | searchPeopleGet | GET /search/people | Returns matching people and information about them. |
uclapi.TimetableApi | timetableBymoduleGet | GET /timetable/bymodule | Returns a yearly timetable for the supplied modules. |
uclapi.TimetableApi | timetableDataCoursesGet | GET /timetable/data/courses | Returns a list of every course taught by a given department at UCL. |
uclapi.TimetableApi | timetableDataCoursesModulesGet | GET /timetable/data/courses/modules | Returns a list of every module taught on a given course at UCL. |
uclapi.TimetableApi | timetableDataDepartmentsGet | GET /timetable/data/departments | Returns a list of every department at UCL, along with its internal name. |
uclapi.TimetableApi | timetableDataModulesGet | GET /timetable/data/modules | Returns a list of every module taught by a given department at UCL. |
uclapi.TimetableApi | timetablePersonalGet | GET /timetable/personal | Returns the personal timetable of the user. |
uclapi.WorkspacesApi | workspacesHistoricalDataGet | GET /workspaces/historical/data | List Historical Data |
uclapi.WorkspacesApi | workspacesHistoricalSensorsGet | GET /workspaces/historical/sensors | List Historical Sensors |
uclapi.WorkspacesApi | workspacesHistoricalSurveysGet | GET /workspaces/historical/surveys | List Historical Surveys |
uclapi.WorkspacesApi | workspacesImagesMapGet | GET /workspaces/images/map | Returns the image specified by the passed in image_id. |
uclapi.WorkspacesApi | workspacesImagesMapLiveGet | GET /workspaces/images/map/live | Takes Survey ID and Map ID as parameters and displays a dynamically generated SVG map. |
uclapi.WorkspacesApi | workspacesSensorsAveragesTimeGet | GET /workspaces/sensors/averages/time | Provides a list of every sensor within every map in a survey/library. |
uclapi.WorkspacesApi | workspacesSensorsGet | GET /workspaces/sensors | Provides a list of every sensor within every map in a survey/library. |
uclapi.WorkspacesApi | workspacesSensorsLastupdatedGet | GET /workspaces/sensors/lastupdated | Replies with the timestamp of the last time the sensor data was updated for a given survey. |
uclapi.WorkspacesApi | workspacesSensorsSummaryGet | GET /workspaces/sensors/summary | Summarises, with a one-minute accuracy, the number of seats within each library region that are free and occupied. |
uclapi.WorkspacesApi | workspacesSurveysGet | GET /workspaces/surveys | Returns all UCL libraries with the Cad-Capture devices fitted to the seats |
- uclapi.Average
- uclapi.AverageWithNameAndId
- uclapi.Booking
- uclapi.Course
- uclapi.Delivery
- uclapi.Department
- uclapi.DesktopData
- uclapi.DesktopDataLocation
- uclapi.Equipment
- uclapi.Error
- uclapi.Event
- uclapi.HistoricalSensor
- uclapi.HistoricalSurvey
- uclapi.HistoricalSurveyData
- uclapi.InlineResponse200
- uclapi.InlineResponse2001
- uclapi.InlineResponse20010
- uclapi.InlineResponse20011
- uclapi.InlineResponse20012
- uclapi.InlineResponse20013
- uclapi.InlineResponse20014
- uclapi.InlineResponse20015
- uclapi.InlineResponse20016
- uclapi.InlineResponse20017
- uclapi.InlineResponse20018
- uclapi.InlineResponse20018Data
- uclapi.InlineResponse20019
- uclapi.InlineResponse20019Data
- uclapi.InlineResponse2002
- uclapi.InlineResponse20020
- uclapi.InlineResponse20020Surveys
- uclapi.InlineResponse20021
- uclapi.InlineResponse20022
- uclapi.InlineResponse20023
- uclapi.InlineResponse20023Data
- uclapi.InlineResponse20024
- uclapi.InlineResponse20024Data
- uclapi.InlineResponse20025
- uclapi.InlineResponse20026
- uclapi.InlineResponse20026Data
- uclapi.InlineResponse20027
- uclapi.InlineResponse20028
- uclapi.InlineResponse20029
- uclapi.InlineResponse20029Categories
- uclapi.InlineResponse2003
- uclapi.InlineResponse20030
- uclapi.InlineResponse20031
- uclapi.InlineResponse20032
- uclapi.InlineResponse20033
- uclapi.InlineResponse20034
- uclapi.InlineResponse20035
- uclapi.InlineResponse20036
- uclapi.InlineResponse20037
- uclapi.InlineResponse20038
- uclapi.InlineResponse20039
- uclapi.InlineResponse2004
- uclapi.InlineResponse20040
- uclapi.InlineResponse20041
- uclapi.InlineResponse20042
- uclapi.InlineResponse2005
- uclapi.InlineResponse2006
- uclapi.InlineResponse2007
- uclapi.InlineResponse2008
- uclapi.InlineResponse2009
- uclapi.Instance
- uclapi.Lecturer
- uclapi.LibcalBooking
- uclapi.LibcalCategory
- uclapi.LibcalForm
- uclapi.LibcalFormField
- uclapi.LibcalLocation
- uclapi.LibcalLocationBase
- uclapi.LibcalPersonalSeatBooking
- uclapi.LibcalReserveRequest
- uclapi.LibcalReserveRequestBooking
- uclapi.LibcalSeat
- uclapi.LibcalSeatBooking
- uclapi.LibcalSpaceBase
- uclapi.LibcalUtilisationSeatSummary
- uclapi.LibcalUtilisationSpaceSummary
- uclapi.LibcalZone
- uclapi.Location
- uclapi.LocationCoordinates
- uclapi.Map
- uclapi.MapWithSensors
- uclapi.Module
- uclapi.ModuleDataCoursesModules
- uclapi.Period
- uclapi.Person
- uclapi.Room
- uclapi.RoomLocation
- uclapi.SeatImage
- uclapi.SeatImageCircle
- uclapi.Sensor
- uclapi.SensorAverageSurvey
- uclapi.SummerSchool
- uclapi.SummerSchoolSessions
- uclapi.Survey
- uclapi.SurveyLocation
- uclapi.SurveyLocationCoordinates
- uclapi.SurveyWithMaps
- uclapi.Svg
- uclapi.SvgG
- uclapi.SvgGImage
- uclapi.TeachingPeriods
- uclapi.Timetable
- uclapi.UserData
- Type: API key
- API key parameter name: token
- Location: URL query string
- Type: OAuth
- Flow: accessCode
- Authorization URL: /oauth/authorise
- Scopes:
- personal_timetable: read user's timetable
- student_number: read user's student number
- libcal_read: read user's LibCal bookings
- libcal_write: reserve/cancel user's LibCal bookings
- Type: API key
- API key parameter name: token
- Location: URL query string