1.4.11 • Published 9 months ago

@uclapi/sdk v1.4.11

Weekly downloads
3
License
MIT License
Repository
-
Last release
9 months ago

@uclapi/sdk

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

Installation

For Node.js

npm

Install the SDK through npm via:

npm install @uclapi/sdk --save

git

If you want to use the SDK via this GitHub repository, then install it via:

npm install uclapi/uclapi-js-sdk --save

For browser

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.

Webpack Configuration

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
      }
    }
  ]
}

Getting Started

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.

Documentation for API Endpoints

All URIs are relative to https://uclapi.com

ClassMethodHTTP requestDescription
uclapi.AnalyticsApidashboardApiAnalyticsMethodsGetGET /dashboard/api/analytics/methodsGets all methods for a given service and their popularity
uclapi.AnalyticsApidashboardApiAnalyticsOauthTotalByDeptGetGET /dashboard/api/analytics/oauth/total_by_deptGets the total number of users for a given app token, by department
uclapi.AnalyticsApidashboardApiAnalyticsOauthTotalGetGET /dashboard/api/analytics/oauth/totalGets the total number of users for a given app token
uclapi.AnalyticsApidashboardApiAnalyticsQuotaGetGET /dashboard/api/analytics/quotaGets the remaining daily quota for a given token
uclapi.AnalyticsApidashboardApiAnalyticsServicesGetGET /dashboard/api/analytics/servicesGets all services and their popularity
uclapi.AnalyticsApidashboardApiAnalyticsTotalGetGET /dashboard/api/analytics/totalGets the total number of requests made from a given token
uclapi.LibCalApilibcalSpaceBookingsGetGET /libcal/space/bookingsGet all LibCal bookings
uclapi.LibCalApilibcalSpaceCancelPostPOST /libcal/space/cancelCancel one or more LibCal bookings
uclapi.LibCalApilibcalSpaceCategoriesGetGET /libcal/space/categoriesReturns the categories of spaces available in the given location(s)
uclapi.LibCalApilibcalSpaceCategoryGetGET /libcal/space/categoryGet all spaces corresponding to the specified categories
uclapi.LibCalApilibcalSpaceFormGetGET /libcal/space/formGet all forms (including fields) corresponding to the given LibCal form ID(s)
uclapi.LibCalApilibcalSpaceItemGetGET /libcal/space/itemGet the spaces corresponding to the given LibCal space ID(s)
uclapi.LibCalApilibcalSpaceLocationsGetGET /libcal/space/locationsGets all LibCal locations
uclapi.LibCalApilibcalSpaceNicknameGetGET /libcal/space/nicknameGet the nicknames asssigned to certain LibCal bookings
uclapi.LibCalApilibcalSpacePersonalBookingsGetGET /libcal/space/personal_bookingsGet all LibCal bookings
uclapi.LibCalApilibcalSpaceQuestionGetGET /libcal/space/questionGet the questions corresponding to the given LibCal field/question ID(s)
uclapi.LibCalApilibcalSpaceReservePostPOST /libcal/space/reserveReserve one or more LibCal spaces/seats
uclapi.LibCalApilibcalSpaceSeatGetGET /libcal/space/seatGet LibCal seat by ID
uclapi.LibCalApilibcalSpaceSeatsGetGET /libcal/space/seatsGet all LibCal seats in a given location
uclapi.LibCalApilibcalSpaceUtilizationGetGET /libcal/space/utilizationGet utilisation stats for a particular location
uclapi.LibCalApilibcalSpaceZoneGetGET /libcal/space/zoneGet LibCal zone by ID
uclapi.LibCalApilibcalSpaceZonesGetGET /libcal/space/zonesGet LibCal zones by location
uclapi.OAuthApioauthAuthoriseGetGET /oauth/authoriseAuthorises a user against the API
uclapi.OAuthApioauthTokenGetGET /oauth/tokenA token will be generated which your app can use to get user’s personal data in JSON format from the OAuthSecurity/user/data.
uclapi.OAuthApioauthUserDataGetGET /oauth/user/dataReturns personal data on a student at UCL.
uclapi.OAuthApioauthUserStudentnumberGetGET /oauth/user/studentnumberYou 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.ResourcesApiresourcesDesktopsGetGET /resources/desktopsReturns number of desktops and how many are free at the time of making the request.
uclapi.RoomBookingsApiroombookingsBookingsGetGET /roombookings/bookingsReturns the results to a bookings or space availability query. It returns a paginated list of bookings.
uclapi.RoomBookingsApiroombookingsEquipmentGetGET /roombookings/equipmentReturns any equipment/feature information about a specific room.
uclapi.RoomBookingsApiroombookingsFreeroomsGetGET /roombookings/freeroomsGiven a start time and an end time, this endpoint returns all rooms which are free in that time range.
uclapi.RoomBookingsApiroombookingsRoomsGetGET /roombookings/roomsReturns rooms and information about them.
uclapi.SearchApisearchPeopleGetGET /search/peopleReturns matching people and information about them.
uclapi.TimetableApitimetableBymoduleGetGET /timetable/bymoduleReturns a yearly timetable for the supplied modules.
uclapi.TimetableApitimetableDataCoursesGetGET /timetable/data/coursesReturns a list of every course taught by a given department at UCL.
uclapi.TimetableApitimetableDataCoursesModulesGetGET /timetable/data/courses/modulesReturns a list of every module taught on a given course at UCL.
uclapi.TimetableApitimetableDataDepartmentsGetGET /timetable/data/departmentsReturns a list of every department at UCL, along with its internal name.
uclapi.TimetableApitimetableDataModulesGetGET /timetable/data/modulesReturns a list of every module taught by a given department at UCL.
uclapi.TimetableApitimetablePersonalGetGET /timetable/personalReturns the personal timetable of the user.
uclapi.WorkspacesApiworkspacesHistoricalDataGetGET /workspaces/historical/dataList Historical Data
uclapi.WorkspacesApiworkspacesHistoricalSensorsGetGET /workspaces/historical/sensorsList Historical Sensors
uclapi.WorkspacesApiworkspacesHistoricalSurveysGetGET /workspaces/historical/surveysList Historical Surveys
uclapi.WorkspacesApiworkspacesImagesMapGetGET /workspaces/images/mapReturns the image specified by the passed in image_id.
uclapi.WorkspacesApiworkspacesImagesMapLiveGetGET /workspaces/images/map/liveTakes Survey ID and Map ID as parameters and displays a dynamically generated SVG map.
uclapi.WorkspacesApiworkspacesSensorsAveragesTimeGetGET /workspaces/sensors/averages/timeProvides a list of every sensor within every map in a survey/library.
uclapi.WorkspacesApiworkspacesSensorsGetGET /workspaces/sensorsProvides a list of every sensor within every map in a survey/library.
uclapi.WorkspacesApiworkspacesSensorsLastupdatedGetGET /workspaces/sensors/lastupdatedReplies with the timestamp of the last time the sensor data was updated for a given survey.
uclapi.WorkspacesApiworkspacesSensorsSummaryGetGET /workspaces/sensors/summarySummarises, with a one-minute accuracy, the number of seats within each library region that are free and occupied.
uclapi.WorkspacesApiworkspacesSurveysGetGET /workspaces/surveysReturns all UCL libraries with the Cad-Capture devices fitted to the seats

Documentation for Models

Documentation for Authorization

ApiToken

  • Type: API key
  • API key parameter name: token
  • Location: URL query string

OAuthSecurity

  • 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

OAuthToken

  • Type: API key
  • API key parameter name: token
  • Location: URL query string
1.4.11

9 months ago

1.4.9

1 year ago

1.4.10

1 year ago

1.4.8

2 years ago

1.4.6

2 years ago

1.4.7

2 years ago

1.4.4

2 years ago

1.4.3

2 years ago

1.1.0

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago