diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 144b5180..19759e7c 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -1,6 +1,5 @@
.babelrc
.gitignore
-.openapi-generator-ignore
.travis.yml
README.md
docs/AnalyticsApi.md
@@ -44,8 +43,25 @@ docs/InlineResponse20024Data.md
docs/InlineResponse20025.md
docs/InlineResponse20026.md
docs/InlineResponse20026Data.md
+docs/InlineResponse20027.md
+docs/InlineResponse20028.md
+docs/InlineResponse20029.md
+docs/InlineResponse20029Categories.md
docs/InlineResponse2003.md
+docs/InlineResponse20030.md
+docs/InlineResponse20031.md
+docs/InlineResponse20032.md
+docs/InlineResponse20033.md
+docs/InlineResponse20034.md
+docs/InlineResponse20035.md
+docs/InlineResponse20036.md
+docs/InlineResponse20037.md
+docs/InlineResponse20038.md
+docs/InlineResponse20039.md
docs/InlineResponse2004.md
+docs/InlineResponse20040.md
+docs/InlineResponse20041.md
+docs/InlineResponse20042.md
docs/InlineResponse2005.md
docs/InlineResponse2006.md
docs/InlineResponse2007.md
@@ -53,6 +69,22 @@ docs/InlineResponse2008.md
docs/InlineResponse2009.md
docs/Instance.md
docs/Lecturer.md
+docs/LibCalApi.md
+docs/LibcalBooking.md
+docs/LibcalCategory.md
+docs/LibcalForm.md
+docs/LibcalFormField.md
+docs/LibcalLocation.md
+docs/LibcalLocationBase.md
+docs/LibcalPersonalSeatBooking.md
+docs/LibcalReserveRequest.md
+docs/LibcalReserveRequestBooking.md
+docs/LibcalSeat.md
+docs/LibcalSeatBooking.md
+docs/LibcalSpaceBase.md
+docs/LibcalUtilisationSeatSummary.md
+docs/LibcalUtilisationSpaceSummary.md
+docs/LibcalZone.md
docs/Location.md
docs/LocationCoordinates.md
docs/Map.md
@@ -90,6 +122,7 @@ mocha.opts
package.json
src/ApiClient.js
src/api/AnalyticsApi.js
+src/api/LibCalApi.js
src/api/OAuthApi.js
src/api/ResourcesApi.js
src/api/RoomBookingsApi.js
@@ -137,8 +170,25 @@ src/model/InlineResponse20024Data.js
src/model/InlineResponse20025.js
src/model/InlineResponse20026.js
src/model/InlineResponse20026Data.js
+src/model/InlineResponse20027.js
+src/model/InlineResponse20028.js
+src/model/InlineResponse20029.js
+src/model/InlineResponse20029Categories.js
src/model/InlineResponse2003.js
+src/model/InlineResponse20030.js
+src/model/InlineResponse20031.js
+src/model/InlineResponse20032.js
+src/model/InlineResponse20033.js
+src/model/InlineResponse20034.js
+src/model/InlineResponse20035.js
+src/model/InlineResponse20036.js
+src/model/InlineResponse20037.js
+src/model/InlineResponse20038.js
+src/model/InlineResponse20039.js
src/model/InlineResponse2004.js
+src/model/InlineResponse20040.js
+src/model/InlineResponse20041.js
+src/model/InlineResponse20042.js
src/model/InlineResponse2005.js
src/model/InlineResponse2006.js
src/model/InlineResponse2007.js
@@ -146,6 +196,21 @@ src/model/InlineResponse2008.js
src/model/InlineResponse2009.js
src/model/Instance.js
src/model/Lecturer.js
+src/model/LibcalBooking.js
+src/model/LibcalCategory.js
+src/model/LibcalForm.js
+src/model/LibcalFormField.js
+src/model/LibcalLocation.js
+src/model/LibcalLocationBase.js
+src/model/LibcalPersonalSeatBooking.js
+src/model/LibcalReserveRequest.js
+src/model/LibcalReserveRequestBooking.js
+src/model/LibcalSeat.js
+src/model/LibcalSeatBooking.js
+src/model/LibcalSpaceBase.js
+src/model/LibcalUtilisationSeatSummary.js
+src/model/LibcalUtilisationSpaceSummary.js
+src/model/LibcalZone.js
src/model/Location.js
src/model/LocationCoordinates.js
src/model/Map.js
@@ -173,6 +238,7 @@ src/model/TeachingPeriods.js
src/model/Timetable.js
src/model/UserData.js
test/api/AnalyticsApi.spec.js
+test/api/LibCalApi.spec.js
test/api/OAuthApi.spec.js
test/api/ResourcesApi.spec.js
test/api/RoomBookingsApi.spec.js
@@ -219,8 +285,25 @@ test/model/InlineResponse20024Data.spec.js
test/model/InlineResponse20025.spec.js
test/model/InlineResponse20026.spec.js
test/model/InlineResponse20026Data.spec.js
+test/model/InlineResponse20027.spec.js
+test/model/InlineResponse20028.spec.js
+test/model/InlineResponse20029.spec.js
+test/model/InlineResponse20029Categories.spec.js
test/model/InlineResponse2003.spec.js
+test/model/InlineResponse20030.spec.js
+test/model/InlineResponse20031.spec.js
+test/model/InlineResponse20032.spec.js
+test/model/InlineResponse20033.spec.js
+test/model/InlineResponse20034.spec.js
+test/model/InlineResponse20035.spec.js
+test/model/InlineResponse20036.spec.js
+test/model/InlineResponse20037.spec.js
+test/model/InlineResponse20038.spec.js
+test/model/InlineResponse20039.spec.js
test/model/InlineResponse2004.spec.js
+test/model/InlineResponse20040.spec.js
+test/model/InlineResponse20041.spec.js
+test/model/InlineResponse20042.spec.js
test/model/InlineResponse2005.spec.js
test/model/InlineResponse2006.spec.js
test/model/InlineResponse2007.spec.js
@@ -228,6 +311,21 @@ test/model/InlineResponse2008.spec.js
test/model/InlineResponse2009.spec.js
test/model/Instance.spec.js
test/model/Lecturer.spec.js
+test/model/LibcalBooking.spec.js
+test/model/LibcalCategory.spec.js
+test/model/LibcalForm.spec.js
+test/model/LibcalFormField.spec.js
+test/model/LibcalLocation.spec.js
+test/model/LibcalLocationBase.spec.js
+test/model/LibcalPersonalSeatBooking.spec.js
+test/model/LibcalReserveRequest.spec.js
+test/model/LibcalReserveRequestBooking.spec.js
+test/model/LibcalSeat.spec.js
+test/model/LibcalSeatBooking.spec.js
+test/model/LibcalSpaceBase.spec.js
+test/model/LibcalUtilisationSeatSummary.spec.js
+test/model/LibcalUtilisationSpaceSummary.spec.js
+test/model/LibcalZone.spec.js
test/model/Location.spec.js
test/model/LocationCoordinates.spec.js
test/model/Map.spec.js
diff --git a/README.md b/README.md
index 8c4c0fc8..3c905086 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,8 @@ See the main UCL API Documentation at .
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
-- API version: 1.0.3
-- Package version: 1.0.3
+- API version: 1.4.2
+- Package version: 1.4.2
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
## Installation
@@ -95,6 +95,22 @@ Class | Method | HTTP request | Description
*uclapi.AnalyticsApi* | [**dashboardApiAnalyticsQuotaGet**](docs/AnalyticsApi.md#dashboardApiAnalyticsQuotaGet) | **GET** /dashboard/api/analytics/quota | Gets the remaining daily quota for a given token
*uclapi.AnalyticsApi* | [**dashboardApiAnalyticsServicesGet**](docs/AnalyticsApi.md#dashboardApiAnalyticsServicesGet) | **GET** /dashboard/api/analytics/services | Gets all services and their popularity
*uclapi.AnalyticsApi* | [**dashboardApiAnalyticsTotalGet**](docs/AnalyticsApi.md#dashboardApiAnalyticsTotalGet) | **GET** /dashboard/api/analytics/total | Gets the total number of requests made from a given token
+*uclapi.LibCalApi* | [**libcalSpaceBookingsGet**](docs/LibCalApi.md#libcalSpaceBookingsGet) | **GET** /libcal/space/bookings | Get all LibCal bookings
+*uclapi.LibCalApi* | [**libcalSpaceCancelPost**](docs/LibCalApi.md#libcalSpaceCancelPost) | **POST** /libcal/space/cancel | Cancel one or more LibCal bookings
+*uclapi.LibCalApi* | [**libcalSpaceCategoriesGet**](docs/LibCalApi.md#libcalSpaceCategoriesGet) | **GET** /libcal/space/categories | Returns the categories of spaces available in the given location(s)
+*uclapi.LibCalApi* | [**libcalSpaceCategoryGet**](docs/LibCalApi.md#libcalSpaceCategoryGet) | **GET** /libcal/space/category | Get all spaces corresponding to the specified categories
+*uclapi.LibCalApi* | [**libcalSpaceFormGet**](docs/LibCalApi.md#libcalSpaceFormGet) | **GET** /libcal/space/form | Get all forms (including fields) corresponding to the given LibCal form ID(s)
+*uclapi.LibCalApi* | [**libcalSpaceItemGet**](docs/LibCalApi.md#libcalSpaceItemGet) | **GET** /libcal/space/item | Get the spaces corresponding to the given LibCal space ID(s)
+*uclapi.LibCalApi* | [**libcalSpaceLocationsGet**](docs/LibCalApi.md#libcalSpaceLocationsGet) | **GET** /libcal/space/locations | Gets all LibCal locations
+*uclapi.LibCalApi* | [**libcalSpaceNicknameGet**](docs/LibCalApi.md#libcalSpaceNicknameGet) | **GET** /libcal/space/nickname | Get the nicknames asssigned to certain LibCal bookings
+*uclapi.LibCalApi* | [**libcalSpacePersonalBookingsGet**](docs/LibCalApi.md#libcalSpacePersonalBookingsGet) | **GET** /libcal/space/personal_bookings | Get all LibCal bookings
+*uclapi.LibCalApi* | [**libcalSpaceQuestionGet**](docs/LibCalApi.md#libcalSpaceQuestionGet) | **GET** /libcal/space/question | Get the questions corresponding to the given LibCal field/question ID(s)
+*uclapi.LibCalApi* | [**libcalSpaceReservePost**](docs/LibCalApi.md#libcalSpaceReservePost) | **POST** /libcal/space/reserve | Reserve one or more LibCal spaces/seats
+*uclapi.LibCalApi* | [**libcalSpaceSeatGet**](docs/LibCalApi.md#libcalSpaceSeatGet) | **GET** /libcal/space/seat | Get LibCal seat by ID
+*uclapi.LibCalApi* | [**libcalSpaceSeatsGet**](docs/LibCalApi.md#libcalSpaceSeatsGet) | **GET** /libcal/space/seats | Get all LibCal seats in a given location
+*uclapi.LibCalApi* | [**libcalSpaceUtilizationGet**](docs/LibCalApi.md#libcalSpaceUtilizationGet) | **GET** /libcal/space/utilization | Get utilisation stats for a particular location
+*uclapi.LibCalApi* | [**libcalSpaceZoneGet**](docs/LibCalApi.md#libcalSpaceZoneGet) | **GET** /libcal/space/zone | Get LibCal zone by ID
+*uclapi.LibCalApi* | [**libcalSpaceZonesGet**](docs/LibCalApi.md#libcalSpaceZonesGet) | **GET** /libcal/space/zones | Get LibCal zones by location
*uclapi.OAuthApi* | [**oauthAuthoriseGet**](docs/OAuthApi.md#oauthAuthoriseGet) | **GET** /oauth/authorise | Authorises a user against the API
*uclapi.OAuthApi* | [**oauthTokenGet**](docs/OAuthApi.md#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**](docs/OAuthApi.md#oauthUserDataGet) | **GET** /oauth/user/data | Returns personal data on a student at UCL.
@@ -165,8 +181,25 @@ Class | Method | HTTP request | Description
- [uclapi.InlineResponse20025](docs/InlineResponse20025.md)
- [uclapi.InlineResponse20026](docs/InlineResponse20026.md)
- [uclapi.InlineResponse20026Data](docs/InlineResponse20026Data.md)
+ - [uclapi.InlineResponse20027](docs/InlineResponse20027.md)
+ - [uclapi.InlineResponse20028](docs/InlineResponse20028.md)
+ - [uclapi.InlineResponse20029](docs/InlineResponse20029.md)
+ - [uclapi.InlineResponse20029Categories](docs/InlineResponse20029Categories.md)
- [uclapi.InlineResponse2003](docs/InlineResponse2003.md)
+ - [uclapi.InlineResponse20030](docs/InlineResponse20030.md)
+ - [uclapi.InlineResponse20031](docs/InlineResponse20031.md)
+ - [uclapi.InlineResponse20032](docs/InlineResponse20032.md)
+ - [uclapi.InlineResponse20033](docs/InlineResponse20033.md)
+ - [uclapi.InlineResponse20034](docs/InlineResponse20034.md)
+ - [uclapi.InlineResponse20035](docs/InlineResponse20035.md)
+ - [uclapi.InlineResponse20036](docs/InlineResponse20036.md)
+ - [uclapi.InlineResponse20037](docs/InlineResponse20037.md)
+ - [uclapi.InlineResponse20038](docs/InlineResponse20038.md)
+ - [uclapi.InlineResponse20039](docs/InlineResponse20039.md)
- [uclapi.InlineResponse2004](docs/InlineResponse2004.md)
+ - [uclapi.InlineResponse20040](docs/InlineResponse20040.md)
+ - [uclapi.InlineResponse20041](docs/InlineResponse20041.md)
+ - [uclapi.InlineResponse20042](docs/InlineResponse20042.md)
- [uclapi.InlineResponse2005](docs/InlineResponse2005.md)
- [uclapi.InlineResponse2006](docs/InlineResponse2006.md)
- [uclapi.InlineResponse2007](docs/InlineResponse2007.md)
@@ -174,6 +207,21 @@ Class | Method | HTTP request | Description
- [uclapi.InlineResponse2009](docs/InlineResponse2009.md)
- [uclapi.Instance](docs/Instance.md)
- [uclapi.Lecturer](docs/Lecturer.md)
+ - [uclapi.LibcalBooking](docs/LibcalBooking.md)
+ - [uclapi.LibcalCategory](docs/LibcalCategory.md)
+ - [uclapi.LibcalForm](docs/LibcalForm.md)
+ - [uclapi.LibcalFormField](docs/LibcalFormField.md)
+ - [uclapi.LibcalLocation](docs/LibcalLocation.md)
+ - [uclapi.LibcalLocationBase](docs/LibcalLocationBase.md)
+ - [uclapi.LibcalPersonalSeatBooking](docs/LibcalPersonalSeatBooking.md)
+ - [uclapi.LibcalReserveRequest](docs/LibcalReserveRequest.md)
+ - [uclapi.LibcalReserveRequestBooking](docs/LibcalReserveRequestBooking.md)
+ - [uclapi.LibcalSeat](docs/LibcalSeat.md)
+ - [uclapi.LibcalSeatBooking](docs/LibcalSeatBooking.md)
+ - [uclapi.LibcalSpaceBase](docs/LibcalSpaceBase.md)
+ - [uclapi.LibcalUtilisationSeatSummary](docs/LibcalUtilisationSeatSummary.md)
+ - [uclapi.LibcalUtilisationSpaceSummary](docs/LibcalUtilisationSpaceSummary.md)
+ - [uclapi.LibcalZone](docs/LibcalZone.md)
- [uclapi.Location](docs/Location.md)
- [uclapi.LocationCoordinates](docs/LocationCoordinates.md)
- [uclapi.Map](docs/Map.md)
@@ -206,15 +254,26 @@ Class | Method | HTTP request | Description
+### ApiToken
+
+
+- **Type**: API key
+- **API key parameter name**: token
+- **Location**: URL query string
+
+
+
### OAuthSecurity
- **Type**: OAuth
- **Flow**: accessCode
-- **Authorization URL**: /authorise
+- **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
diff --git a/docs/InlineResponse20027.md b/docs/InlineResponse20027.md
new file mode 100644
index 00000000..b5340ad2
--- /dev/null
+++ b/docs/InlineResponse20027.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20027
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**data** | [**[LibcalLocation]**](LibcalLocation.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20028.md b/docs/InlineResponse20028.md
new file mode 100644
index 00000000..7733a90e
--- /dev/null
+++ b/docs/InlineResponse20028.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20028
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**categories** | [**[LibcalLocationBase]**](LibcalLocationBase.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20029.md b/docs/InlineResponse20029.md
new file mode 100644
index 00000000..bca38842
--- /dev/null
+++ b/docs/InlineResponse20029.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20029
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**categories** | [**[InlineResponse20029Categories]**](InlineResponse20029Categories.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20029Categories.md b/docs/InlineResponse20029Categories.md
new file mode 100644
index 00000000..6310def7
--- /dev/null
+++ b/docs/InlineResponse20029Categories.md
@@ -0,0 +1,12 @@
+# uclapi.InlineResponse20029Categories
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**cid** | **Number** | LibCal category ID denoting a category assigned to a particular space | [optional]
+**formid** | **Number** | LibCal booking form ID | [optional]
+**_public** | **Number** | 1 if the category of spaces is publicly-bookable, 0 if it is not | [optional]
+**items** | **[Number]** | | [optional]
+
+
diff --git a/docs/InlineResponse20030.md b/docs/InlineResponse20030.md
new file mode 100644
index 00000000..9859c879
--- /dev/null
+++ b/docs/InlineResponse20030.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20030
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**forms** | [**[LibcalForm]**](LibcalForm.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20031.md b/docs/InlineResponse20031.md
new file mode 100644
index 00000000..b7f14314
--- /dev/null
+++ b/docs/InlineResponse20031.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20031
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**questions** | [**[LibcalFormField]**](LibcalFormField.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20032.md b/docs/InlineResponse20032.md
new file mode 100644
index 00000000..7d77ec57
--- /dev/null
+++ b/docs/InlineResponse20032.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20032
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**questions** | [**[LibcalSpaceBase]**](LibcalSpaceBase.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20033.md b/docs/InlineResponse20033.md
new file mode 100644
index 00000000..60485286
--- /dev/null
+++ b/docs/InlineResponse20033.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20033
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**categories** | **[Object]** | | [optional]
+
+
diff --git a/docs/InlineResponse20034.md b/docs/InlineResponse20034.md
new file mode 100644
index 00000000..cc557be4
--- /dev/null
+++ b/docs/InlineResponse20034.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20034
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**data** | **Object** | | [optional]
+
+
diff --git a/docs/InlineResponse20035.md b/docs/InlineResponse20035.md
new file mode 100644
index 00000000..7c5185a8
--- /dev/null
+++ b/docs/InlineResponse20035.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20035
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**seats** | [**[LibcalSeat]**](LibcalSeat.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20036.md b/docs/InlineResponse20036.md
new file mode 100644
index 00000000..7df3b2df
--- /dev/null
+++ b/docs/InlineResponse20036.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20036
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**seat** | [**LibcalSeat**](LibcalSeat.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20037.md b/docs/InlineResponse20037.md
new file mode 100644
index 00000000..7188a13b
--- /dev/null
+++ b/docs/InlineResponse20037.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20037
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**zones** | [**[LibcalZone]**](LibcalZone.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20038.md b/docs/InlineResponse20038.md
new file mode 100644
index 00000000..139bd0bb
--- /dev/null
+++ b/docs/InlineResponse20038.md
@@ -0,0 +1,11 @@
+# uclapi.InlineResponse20038
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**error** | **String** | Will be returned if there is an error retrieving the given LibCal space, e.g. if the space ID provided is invalid | [optional]
+**zone** | [**LibcalZone**](LibcalZone.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20039.md b/docs/InlineResponse20039.md
new file mode 100644
index 00000000..600acba9
--- /dev/null
+++ b/docs/InlineResponse20039.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20039
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**bookings** | [**[LibcalSeatBooking]**](LibcalSeatBooking.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20040.md b/docs/InlineResponse20040.md
new file mode 100644
index 00000000..ce0b2b79
--- /dev/null
+++ b/docs/InlineResponse20040.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20040
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**bookings** | [**[LibcalPersonalSeatBooking]**](LibcalPersonalSeatBooking.md) | | [optional]
+
+
diff --git a/docs/InlineResponse20041.md b/docs/InlineResponse20041.md
new file mode 100644
index 00000000..d2393b02
--- /dev/null
+++ b/docs/InlineResponse20041.md
@@ -0,0 +1,11 @@
+# uclapi.InlineResponse20041
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**error** | **Object** | Will only be returned if there are errors | [optional]
+**bookings** | **Object** | | [optional]
+
+
diff --git a/docs/InlineResponse20042.md b/docs/InlineResponse20042.md
new file mode 100644
index 00000000..a938b2b8
--- /dev/null
+++ b/docs/InlineResponse20042.md
@@ -0,0 +1,10 @@
+# uclapi.InlineResponse20042
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**ok** | **Boolean** | | [optional]
+**bookings** | **[Object]** | | [optional]
+
+
diff --git a/docs/LibCalApi.md b/docs/LibCalApi.md
new file mode 100644
index 00000000..8028d706
--- /dev/null
+++ b/docs/LibCalApi.md
@@ -0,0 +1,897 @@
+# uclapi.LibCalApi
+
+All URIs are relative to *https://uclapi.com*
+
+Method | HTTP request | Description
+------------- | ------------- | -------------
+[**libcalSpaceBookingsGet**](LibCalApi.md#libcalSpaceBookingsGet) | **GET** /libcal/space/bookings | Get all LibCal bookings
+[**libcalSpaceCancelPost**](LibCalApi.md#libcalSpaceCancelPost) | **POST** /libcal/space/cancel | Cancel one or more LibCal bookings
+[**libcalSpaceCategoriesGet**](LibCalApi.md#libcalSpaceCategoriesGet) | **GET** /libcal/space/categories | Returns the categories of spaces available in the given location(s)
+[**libcalSpaceCategoryGet**](LibCalApi.md#libcalSpaceCategoryGet) | **GET** /libcal/space/category | Get all spaces corresponding to the specified categories
+[**libcalSpaceFormGet**](LibCalApi.md#libcalSpaceFormGet) | **GET** /libcal/space/form | Get all forms (including fields) corresponding to the given LibCal form ID(s)
+[**libcalSpaceItemGet**](LibCalApi.md#libcalSpaceItemGet) | **GET** /libcal/space/item | Get the spaces corresponding to the given LibCal space ID(s)
+[**libcalSpaceLocationsGet**](LibCalApi.md#libcalSpaceLocationsGet) | **GET** /libcal/space/locations | Gets all LibCal locations
+[**libcalSpaceNicknameGet**](LibCalApi.md#libcalSpaceNicknameGet) | **GET** /libcal/space/nickname | Get the nicknames asssigned to certain LibCal bookings
+[**libcalSpacePersonalBookingsGet**](LibCalApi.md#libcalSpacePersonalBookingsGet) | **GET** /libcal/space/personal_bookings | Get all LibCal bookings
+[**libcalSpaceQuestionGet**](LibCalApi.md#libcalSpaceQuestionGet) | **GET** /libcal/space/question | Get the questions corresponding to the given LibCal field/question ID(s)
+[**libcalSpaceReservePost**](LibCalApi.md#libcalSpaceReservePost) | **POST** /libcal/space/reserve | Reserve one or more LibCal spaces/seats
+[**libcalSpaceSeatGet**](LibCalApi.md#libcalSpaceSeatGet) | **GET** /libcal/space/seat | Get LibCal seat by ID
+[**libcalSpaceSeatsGet**](LibCalApi.md#libcalSpaceSeatsGet) | **GET** /libcal/space/seats | Get all LibCal seats in a given location
+[**libcalSpaceUtilizationGet**](LibCalApi.md#libcalSpaceUtilizationGet) | **GET** /libcal/space/utilization | Get utilisation stats for a particular location
+[**libcalSpaceZoneGet**](LibCalApi.md#libcalSpaceZoneGet) | **GET** /libcal/space/zone | Get LibCal zone by ID
+[**libcalSpaceZonesGet**](LibCalApi.md#libcalSpaceZonesGet) | **GET** /libcal/space/zones | Get LibCal zones by location
+
+
+
+## libcalSpaceBookingsGet
+
+> InlineResponse20039 libcalSpaceBookingsGet(opts)
+
+Get all LibCal bookings
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let opts = {
+ 'eid': 469,470, // String | Comma delimited list of LibCal space IDs. If specified, will only show bookings for those spaces.
+ 'seatId': 54435,54436, // String | Comma delimited list of LibCal seat IDs. If specified, will only show bookings for those seats.
+ 'cid': 3334, // String | Comma delimited list of LibCal category IDs. If specified, will only show bookings for those categories.
+ 'lid': 702,703, // String | Comma delimited list of LibCal location IDs. If specified, will only show bookings for those locations.
+ '_date': 2021-06-01, // String | Date in YYYY-MM-DD format. If specified, will only show bookings made on this date. Dates in the past are ignored. Defaults to today's date.
+ 'days': 3, // Number | Number of days into the future to retrieve bookings from, starting from the data parameter. Defaults to zero. Must be >= 0 and <= 365.
+ 'limit': 10 // Number | Maximum number of bookings to return. Defaults to 20. The maximum value is 500.
+};
+apiInstance.libcalSpaceBookingsGet(opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **eid** | **String**| Comma delimited list of LibCal space IDs. If specified, will only show bookings for those spaces. | [optional]
+ **seatId** | **String**| Comma delimited list of LibCal seat IDs. If specified, will only show bookings for those seats. | [optional]
+ **cid** | **String**| Comma delimited list of LibCal category IDs. If specified, will only show bookings for those categories. | [optional]
+ **lid** | **String**| Comma delimited list of LibCal location IDs. If specified, will only show bookings for those locations. | [optional]
+ **_date** | **String**| Date in YYYY-MM-DD format. If specified, will only show bookings made on this date. Dates in the past are ignored. Defaults to today's date. | [optional]
+ **days** | **Number**| Number of days into the future to retrieve bookings from, starting from the data parameter. Defaults to zero. Must be >= 0 and <= 365. | [optional]
+ **limit** | **Number**| Maximum number of bookings to return. Defaults to 20. The maximum value is 500. | [optional]
+
+### Return type
+
+[**InlineResponse20039**](InlineResponse20039.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceCancelPost
+
+> InlineResponse20042 libcalSpaceCancelPost(id)
+
+Cancel one or more LibCal bookings
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure OAuth2 access token for authorization: OAuthSecurity
+let OAuthSecurity = defaultClient.authentications['OAuthSecurity'];
+OAuthSecurity.accessToken = 'YOUR ACCESS TOKEN';
+// Configure API key authorization: OAuthToken
+let OAuthToken = defaultClient.authentications['OAuthToken'];
+OAuthToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//OAuthToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let id = cs_loYG4wTz,ab_P1bn30Mn; // String | A comma delimited list of LibCal booking IDs to cancel
+apiInstance.libcalSpaceCancelPost(id, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **id** | **String**| A comma delimited list of LibCal booking IDs to cancel |
+
+### Return type
+
+[**InlineResponse20042**](InlineResponse20042.md)
+
+### Authorization
+
+[OAuthSecurity](../README.md#OAuthSecurity), [OAuthToken](../README.md#OAuthToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceCategoriesGet
+
+> InlineResponse20028 libcalSpaceCategoriesGet(ids)
+
+Returns the categories of spaces available in the given location(s)
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 702,703; // String | Comma delimited list of LibCal location IDs
+apiInstance.libcalSpaceCategoriesGet(ids, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal location IDs |
+
+### Return type
+
+[**InlineResponse20028**](InlineResponse20028.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceCategoryGet
+
+> InlineResponse20029 libcalSpaceCategoryGet(ids, opts)
+
+Get all spaces corresponding to the specified categories
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 3334,3335; // String | Comma delimited list of LibCal category IDs
+let opts = {
+ 'details': 1, // Number | Flag to indicate you want additional details such as terms and conditions.
+ 'availability': 2021-01-05 // String | Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+};
+apiInstance.libcalSpaceCategoryGet(ids, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal category IDs |
+ **details** | **Number**| Flag to indicate you want additional details such as terms and conditions. | [optional]
+ **availability** | **String**| Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format. | [optional]
+
+### Return type
+
+[**InlineResponse20029**](InlineResponse20029.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceFormGet
+
+> InlineResponse20030 libcalSpaceFormGet(ids)
+
+Get all forms (including fields) corresponding to the given LibCal form ID(s)
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 38,62; // String | Comma delimited list of LibCal form IDs
+apiInstance.libcalSpaceFormGet(ids, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal form IDs |
+
+### Return type
+
+[**InlineResponse20030**](InlineResponse20030.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceItemGet
+
+> InlineResponse20032 libcalSpaceItemGet(ids, opts)
+
+Get the spaces corresponding to the given LibCal space ID(s)
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 469,470; // String | Comma delimited list of LibCal space IDs
+let opts = {
+ 'availability': 2021-01-05 // String | Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+};
+apiInstance.libcalSpaceItemGet(ids, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal space IDs |
+ **availability** | **String**| Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format. | [optional]
+
+### Return type
+
+[**InlineResponse20032**](InlineResponse20032.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceLocationsGet
+
+> InlineResponse20027 libcalSpaceLocationsGet(opts)
+
+Gets all LibCal locations
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let opts = {
+ 'details': 1 // Number | Flag to indicate you want additional details such as terms and conditions.
+};
+apiInstance.libcalSpaceLocationsGet(opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **details** | **Number**| Flag to indicate you want additional details such as terms and conditions. | [optional]
+
+### Return type
+
+[**InlineResponse20027**](InlineResponse20027.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceNicknameGet
+
+> InlineResponse20033 libcalSpaceNicknameGet(ids, opts)
+
+Get the nicknames asssigned to certain LibCal bookings
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 3334,3335; // String | Comma delimited list of LibCal category IDs
+let opts = {
+ 'availability': 2021-01-05 // String | Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+};
+apiInstance.libcalSpaceNicknameGet(ids, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal category IDs |
+ **availability** | **String**| Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format. | [optional]
+
+### Return type
+
+[**InlineResponse20033**](InlineResponse20033.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpacePersonalBookingsGet
+
+> InlineResponse20040 libcalSpacePersonalBookingsGet(clientSecret, opts)
+
+Get all LibCal bookings
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure OAuth2 access token for authorization: OAuthSecurity
+let OAuthSecurity = defaultClient.authentications['OAuthSecurity'];
+OAuthSecurity.accessToken = 'YOUR ACCESS TOKEN';
+// Configure API key authorization: OAuthToken
+let OAuthToken = defaultClient.authentications['OAuthToken'];
+OAuthToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//OAuthToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let clientSecret = "clientSecret_example"; // String | Client secret of the authenticating app.
+let opts = {
+ 'eid': 469,470, // String | Comma delimited list of LibCal space IDs. If specified, will only show bookings for those spaces.
+ 'seatId': 54435,54436, // String | Comma delimited list of LibCal seat IDs. If specified, will only show bookings for those seats.
+ 'cid': 3334, // String | Comma delimited list of LibCal category IDs. If specified, will only show bookings for those categories.
+ 'lid': 702,703, // String | Comma delimited list of LibCal location IDs. If specified, will only show bookings for those locations.
+ 'email': isd_apiteam@ucl.ac.uk, // String | If specified, will only show bookings made with this email address
+ '_date': 2021-06-01, // String | Date in YYYY-MM-DD format. If specified, will only show bookings made on this date. Dates in the past are ignored. Defaults to today's date.
+ 'days': 3, // Number | Number of days into the future to retrieve bookings from, starting from the data parameter. Defaults to zero. Must be >= 0 and <= 365.
+ 'limit': 10, // Number | Maximum number of bookings to return. Defaults to 20. The maximum value is 500.
+ 'formAnswers': true // Boolean | Whether or not form answers should be returned. Defaults to false.
+};
+apiInstance.libcalSpacePersonalBookingsGet(clientSecret, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **clientSecret** | **String**| Client secret of the authenticating app. |
+ **eid** | **String**| Comma delimited list of LibCal space IDs. If specified, will only show bookings for those spaces. | [optional]
+ **seatId** | **String**| Comma delimited list of LibCal seat IDs. If specified, will only show bookings for those seats. | [optional]
+ **cid** | **String**| Comma delimited list of LibCal category IDs. If specified, will only show bookings for those categories. | [optional]
+ **lid** | **String**| Comma delimited list of LibCal location IDs. If specified, will only show bookings for those locations. | [optional]
+ **email** | **String**| If specified, will only show bookings made with this email address | [optional]
+ **_date** | **String**| Date in YYYY-MM-DD format. If specified, will only show bookings made on this date. Dates in the past are ignored. Defaults to today's date. | [optional]
+ **days** | **Number**| Number of days into the future to retrieve bookings from, starting from the data parameter. Defaults to zero. Must be >= 0 and <= 365. | [optional]
+ **limit** | **Number**| Maximum number of bookings to return. Defaults to 20. The maximum value is 500. | [optional]
+ **formAnswers** | **Boolean**| Whether or not form answers should be returned. Defaults to false. | [optional]
+
+### Return type
+
+[**InlineResponse20040**](InlineResponse20040.md)
+
+### Authorization
+
+[OAuthSecurity](../README.md#OAuthSecurity), [OAuthToken](../README.md#OAuthToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceQuestionGet
+
+> InlineResponse20031 libcalSpaceQuestionGet(ids)
+
+Get the questions corresponding to the given LibCal field/question ID(s)
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 43,8; // String | Comma delimited list of LibCal field/question IDs
+apiInstance.libcalSpaceQuestionGet(ids, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal field/question IDs |
+
+### Return type
+
+[**InlineResponse20031**](InlineResponse20031.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceReservePost
+
+> InlineResponse20041 libcalSpaceReservePost(libcalReserveRequest)
+
+Reserve one or more LibCal spaces/seats
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure OAuth2 access token for authorization: OAuthSecurity
+let OAuthSecurity = defaultClient.authentications['OAuthSecurity'];
+OAuthSecurity.accessToken = 'YOUR ACCESS TOKEN';
+// Configure API key authorization: OAuthToken
+let OAuthToken = defaultClient.authentications['OAuthToken'];
+OAuthToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//OAuthToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let libcalReserveRequest = new uclapi.LibcalReserveRequest(); // LibcalReserveRequest |
+apiInstance.libcalSpaceReservePost(libcalReserveRequest, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **libcalReserveRequest** | [**LibcalReserveRequest**](LibcalReserveRequest.md)| |
+
+### Return type
+
+[**InlineResponse20041**](InlineResponse20041.md)
+
+### Authorization
+
+[OAuthSecurity](../README.md#OAuthSecurity), [OAuthToken](../README.md#OAuthToken)
+
+### HTTP request headers
+
+- **Content-Type**: application/json
+- **Accept**: application/json
+
+
+## libcalSpaceSeatGet
+
+> InlineResponse20036 libcalSpaceSeatGet(ids, opts)
+
+Get LibCal seat by ID
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 3334,3335; // String | Comma delimited list of LibCal category IDs
+let opts = {
+ 'availability': 2021-01-05 // String | Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+};
+apiInstance.libcalSpaceSeatGet(ids, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| Comma delimited list of LibCal category IDs |
+ **availability** | **String**| Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format. | [optional]
+
+### Return type
+
+[**InlineResponse20036**](InlineResponse20036.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceSeatsGet
+
+> InlineResponse20035 libcalSpaceSeatsGet(ids, opts)
+
+Get all LibCal seats in a given location
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 702; // String | A single LibCal location ID
+let opts = {
+ 'spaceId': 1791, // String | If specified, only return data for this space
+ 'categoryId': 3334, // String | If specified, will only return data for that category
+ 'seatId': 54435, // String | Show only the seat with this ID. If this is specified, spaceId, categoryId, and zoneId will be ignored.
+ 'accessibleOnly': false, // Boolean | Return only acessible seats (i.e. seats with height-adjustable furniture).
+ 'availability': 2021-01-05, // String | Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+ 'pageIndex': 0, // Number | For pagination purposes, this specifies the page to be retrieved. Starts at 0 for the first page.
+ 'pageSize': 10 // Number | For pagination purposes, this specifies the number of results per page. Must be >= 1 and <= 100. The default is 20.
+};
+apiInstance.libcalSpaceSeatsGet(ids, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| A single LibCal location ID |
+ **spaceId** | **String**| If specified, only return data for this space | [optional]
+ **categoryId** | **String**| If specified, will only return data for that category | [optional]
+ **seatId** | **String**| Show only the seat with this ID. If this is specified, spaceId, categoryId, and zoneId will be ignored. | [optional]
+ **accessibleOnly** | **Boolean**| Return only acessible seats (i.e. seats with height-adjustable furniture). | [optional]
+ **availability** | **String**| Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format. | [optional]
+ **pageIndex** | **Number**| For pagination purposes, this specifies the page to be retrieved. Starts at 0 for the first page. | [optional]
+ **pageSize** | **Number**| For pagination purposes, this specifies the number of results per page. Must be >= 1 and <= 100. The default is 20. | [optional]
+
+### Return type
+
+[**InlineResponse20035**](InlineResponse20035.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceUtilizationGet
+
+> InlineResponse20034 libcalSpaceUtilizationGet(ids, opts)
+
+Get utilisation stats for a particular location
+
+Optionally filter by categoryId and zoneId
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 702; // String | A single LibCal location ID
+let opts = {
+ 'categoryId': 3334, // String | If specified, will only return data for that category
+ 'zoneId': 87 // String | If specified, will only return data for that zone
+};
+apiInstance.libcalSpaceUtilizationGet(ids, opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| A single LibCal location ID |
+ **categoryId** | **String**| If specified, will only return data for that category | [optional]
+ **zoneId** | **String**| If specified, will only return data for that zone | [optional]
+
+### Return type
+
+[**InlineResponse20034**](InlineResponse20034.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceZoneGet
+
+> InlineResponse20038 libcalSpaceZoneGet(opts)
+
+Get LibCal zone by ID
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let opts = {
+ 'zoneId': 87 // String | If specified, will only return data for that zone
+};
+apiInstance.libcalSpaceZoneGet(opts, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **zoneId** | **String**| If specified, will only return data for that zone | [optional]
+
+### Return type
+
+[**InlineResponse20038**](InlineResponse20038.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
+
+## libcalSpaceZonesGet
+
+> InlineResponse20037 libcalSpaceZonesGet(ids)
+
+Get LibCal zones by location
+
+### Example
+
+```javascript
+import uclapi from '@uclapi/sdk';
+let defaultClient = uclapi.ApiClient.instance;
+// Configure API key authorization: ApiToken
+let ApiToken = defaultClient.authentications['ApiToken'];
+ApiToken.apiKey = 'YOUR API KEY';
+// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
+//ApiToken.apiKeyPrefix = 'Token';
+
+let apiInstance = new uclapi.LibCalApi();
+let ids = 702; // String | A single LibCal location ID
+apiInstance.libcalSpaceZonesGet(ids, (error, data, response) => {
+ if (error) {
+ console.error(error);
+ } else {
+ console.log('API called successfully. Returned data: ' + data);
+ }
+});
+```
+
+### Parameters
+
+
+Name | Type | Description | Notes
+------------- | ------------- | ------------- | -------------
+ **ids** | **String**| A single LibCal location ID |
+
+### Return type
+
+[**InlineResponse20037**](InlineResponse20037.md)
+
+### Authorization
+
+[ApiToken](../README.md#ApiToken)
+
+### HTTP request headers
+
+- **Content-Type**: Not defined
+- **Accept**: application/json
+
diff --git a/docs/LibcalBooking.md b/docs/LibcalBooking.md
new file mode 100644
index 00000000..22dfae97
--- /dev/null
+++ b/docs/LibcalBooking.md
@@ -0,0 +1,13 @@
+# uclapi.LibcalBooking
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**nickname** | **String** | Nickname assigned to this LibCal booking | [optional]
+**start** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking starts | [optional]
+**end** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking ends | [optional]
+**created** | **String** | Timestamp (in ISO 8601 format) denoting when this LibCal booking was created | [optional]
+**bookingId** | **String** | ID assigned to this LibCal booking | [optional]
+
+
diff --git a/docs/LibcalCategory.md b/docs/LibcalCategory.md
new file mode 100644
index 00000000..6dc13143
--- /dev/null
+++ b/docs/LibcalCategory.md
@@ -0,0 +1,12 @@
+# uclapi.LibcalCategory
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**cid** | **Number** | LibCal category ID denoting a category assigned to a particular space | [optional]
+**formid** | **Number** | LibCal booking form ID | [optional]
+**name** | **String** | Name of the category | [optional]
+**_public** | **Number** | 1 if the category of spaces is publicly-bookable, 0 if it is not | [optional]
+
+
diff --git a/docs/LibcalForm.md b/docs/LibcalForm.md
new file mode 100644
index 00000000..e390cb9c
--- /dev/null
+++ b/docs/LibcalForm.md
@@ -0,0 +1,11 @@
+# uclapi.LibcalForm
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | LibCal booking form ID | [optional]
+**name** | **String** | Name of the LibCal booking form | [optional]
+**fields** | [**[LibcalFormField]**](LibcalFormField.md) | | [optional]
+
+
diff --git a/docs/LibcalFormField.md b/docs/LibcalFormField.md
new file mode 100644
index 00000000..0004e84a
--- /dev/null
+++ b/docs/LibcalFormField.md
@@ -0,0 +1,12 @@
+# uclapi.LibcalFormField
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**label** | **String** | Label for the field in the LibCal booking form | [optional]
+**type** | **String** | Field type for the field in the LibCal booking form. Examples of field types include 'string' and 'dropdown'. | [optional]
+**required** | **Boolean** | Whether the field in the LibCal booking form is required (true) or optional (false) | [optional]
+**options** | **[String]** | Array of options that will be provided if the field type is dropdown | [optional]
+
+
diff --git a/docs/LibcalLocation.md b/docs/LibcalLocation.md
new file mode 100644
index 00000000..043c74cf
--- /dev/null
+++ b/docs/LibcalLocation.md
@@ -0,0 +1,12 @@
+# uclapi.LibcalLocation
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**_public** | **Number** | 1 if the location is publicly-bookable, 0 if it is not | [optional]
+**terms** | **String** | Additional details about the location, such as terms & conditions. May include HTML. | [optional]
+**lid** | **Number** | ID for the LibCal location in question | [optional]
+**name** | **String** | Name of the LibCal location in question | [optional]
+
+
diff --git a/docs/LibcalLocationBase.md b/docs/LibcalLocationBase.md
new file mode 100644
index 00000000..23057240
--- /dev/null
+++ b/docs/LibcalLocationBase.md
@@ -0,0 +1,10 @@
+# uclapi.LibcalLocationBase
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**lid** | **Number** | ID for the LibCal location in question | [optional]
+**name** | **String** | Name of the LibCal location in question | [optional]
+
+
diff --git a/docs/LibcalPersonalSeatBooking.md b/docs/LibcalPersonalSeatBooking.md
new file mode 100644
index 00000000..520541fd
--- /dev/null
+++ b/docs/LibcalPersonalSeatBooking.md
@@ -0,0 +1,26 @@
+# uclapi.LibcalPersonalSeatBooking
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**bookId** | **String** | ID assigned to this LibCal booking | [optional]
+**firstName** | **String** | First name of the user who booked this | [optional]
+**lastName** | **String** | Last name of the user who booked this | [optional]
+**email** | **String** | Email address of the user who booked this | [optional]
+**checkInCode** | **String** | Email address of the user who booked this | [optional]
+**eid** | **Number** | ID of this LibCal space | [optional]
+**cid** | **Number** | LibCal category ID denoting a category assigned to a particular space | [optional]
+**lid** | **Number** | LibCal Location ID | [optional]
+**fromDate** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking starts | [optional]
+**toDate** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking ends | [optional]
+**created** | **String** | Timestamp (in ISO 8601 format) denoting when this LibCal booking was created | [optional]
+**status** | **String** | Status of this LibCal booking | [optional]
+**locationName** | **String** | Name of the LibCal location in question | [optional]
+**categoryName** | **String** | Name of the category | [optional]
+**itemName** | **String** | Name of this LibCal space | [optional]
+**seatId** | **Number** | LibCal seat ID | [optional]
+**seatName** | **String** | Name of the LibCal seat | [optional]
+**cancelled** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking was cancelled, if applicable | [optional]
+
+
diff --git a/docs/LibcalReserveRequest.md b/docs/LibcalReserveRequest.md
new file mode 100644
index 00000000..6edcbcf8
--- /dev/null
+++ b/docs/LibcalReserveRequest.md
@@ -0,0 +1,12 @@
+# uclapi.LibcalReserveRequest
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**start** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking starts |
+**test** | **Number** | Whether or not this is a test booking. If set, the system will process the booking but will not actually make it. This is useful during development. |
+**nickname** | **String** | If the space to be booked has a nickname, then the nickname must be supplied here. | [optional]
+**bookings** | [**[LibcalReserveRequestBooking]**](LibcalReserveRequestBooking.md) | | [optional]
+
+
diff --git a/docs/LibcalReserveRequestBooking.md b/docs/LibcalReserveRequestBooking.md
new file mode 100644
index 00000000..5e952cdf
--- /dev/null
+++ b/docs/LibcalReserveRequestBooking.md
@@ -0,0 +1,11 @@
+# uclapi.LibcalReserveRequestBooking
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | ID of this LibCal space |
+**to** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking ends |
+**seatId** | **Number** | LibCal seat ID | [optional]
+
+
diff --git a/docs/LibcalSeat.md b/docs/LibcalSeat.md
new file mode 100644
index 00000000..04d911b0
--- /dev/null
+++ b/docs/LibcalSeat.md
@@ -0,0 +1,15 @@
+# uclapi.LibcalSeat
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | LibCal seat ID | [optional]
+**name** | **String** | Name of the LibCal seat | [optional]
+**description** | **String** | Description provided for the LibCal seat. May contain HTML | [optional]
+**isAccessible** | **Boolean** | Whether the seat is height-adjustable and hence accessible by the differently-abled | [optional]
+**isPowered** | **Boolean** | Whether a power socket is available at the seat | [optional]
+**image** | **String** | A URL pointing to an image of the seat. If none is available, an empty string will be returned | [optional]
+**status** | **Boolean** | The current status of the seat | [optional]
+
+
diff --git a/docs/LibcalSeatBooking.md b/docs/LibcalSeatBooking.md
new file mode 100644
index 00000000..2d50b09c
--- /dev/null
+++ b/docs/LibcalSeatBooking.md
@@ -0,0 +1,21 @@
+# uclapi.LibcalSeatBooking
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**eid** | **Number** | ID of this LibCal space | [optional]
+**cid** | **Number** | LibCal category ID denoting a category assigned to a particular space | [optional]
+**lid** | **Number** | LibCal Location ID | [optional]
+**fromDate** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking starts | [optional]
+**toDate** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking ends | [optional]
+**created** | **String** | Timestamp (in ISO 8601 format) denoting when this LibCal booking was created | [optional]
+**status** | **String** | Status of this LibCal booking | [optional]
+**locationName** | **String** | Name of the LibCal location in question | [optional]
+**categoryName** | **String** | Name of the category | [optional]
+**itemName** | **String** | Name of this LibCal space | [optional]
+**seatId** | **Number** | LibCal seat ID | [optional]
+**seatName** | **String** | Name of the LibCal seat | [optional]
+**cancelled** | **String** | Timestamp (in ISO 8601 format) at which this LibCal booking was cancelled, if applicable | [optional]
+
+
diff --git a/docs/LibcalSpaceBase.md b/docs/LibcalSpaceBase.md
new file mode 100644
index 00000000..7db4d521
--- /dev/null
+++ b/docs/LibcalSpaceBase.md
@@ -0,0 +1,14 @@
+# uclapi.LibcalSpaceBase
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | ID of this LibCal space | [optional]
+**name** | **String** | Name of this LibCal space | [optional]
+**description** | **String** | Description of this LibCal space | [optional]
+**image** | **String** | URL pointing to an image depicting this LibCal space | [optional]
+**capacity** | **Number** | Maximum number of persons this LibCal space can accommodate | [optional]
+**formid** | **Number** | ID of the form associated with this LibCal space | [optional]
+
+
diff --git a/docs/LibcalUtilisationSeatSummary.md b/docs/LibcalUtilisationSeatSummary.md
new file mode 100644
index 00000000..7c7d773c
--- /dev/null
+++ b/docs/LibcalUtilisationSeatSummary.md
@@ -0,0 +1,11 @@
+# uclapi.LibcalUtilisationSeatSummary
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**active** | **Number** | Number of active LibCal bookings of seats | [optional]
+**bookableCount** | **Number** | Number of LibCal seats available to be booked | [optional]
+**total** | **Number** | Total number of LibCal seats in the location | [optional]
+
+
diff --git a/docs/LibcalUtilisationSpaceSummary.md b/docs/LibcalUtilisationSpaceSummary.md
new file mode 100644
index 00000000..095bf4b4
--- /dev/null
+++ b/docs/LibcalUtilisationSpaceSummary.md
@@ -0,0 +1,11 @@
+# uclapi.LibcalUtilisationSpaceSummary
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**active** | **Number** | Number of active LibCal bookings of spaces | [optional]
+**bookableCount** | **Number** | Number of LibCal spaces available to be booked | [optional]
+**total** | **Number** | Total number of LibCal spaces in the location | [optional]
+
+
diff --git a/docs/LibcalZone.md b/docs/LibcalZone.md
new file mode 100644
index 00000000..75529779
--- /dev/null
+++ b/docs/LibcalZone.md
@@ -0,0 +1,10 @@
+# uclapi.LibcalZone
+
+## Properties
+
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**id** | **Number** | LibCal Zone ID | [optional]
+**name** | **String** | Name of the LibCal zone | [optional]
+
+
diff --git a/openapitools.json b/openapitools.json
index 6dff05ce..a00efaee 100644
--- a/openapitools.json
+++ b/openapitools.json
@@ -11,7 +11,7 @@
"templateDir": "#{cwd}/sdk-templates",
"additionalProperties": {
"projectName": "@uclapi/sdk",
- "projectVersion": "1.0.3",
+ "projectVersion": "1.4.2",
"moduleName": "uclapi",
"projectDescription": "UCL API JavaScript SDK"
}
diff --git a/package.json b/package.json
index 9786808b..f0d35c87 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@uclapi/sdk",
- "version": "1.0.3",
+ "version": "1.4.2",
"description": "UCL API JavaScript SDK",
"license": "MIT License",
"main": "dist/index.js",
diff --git a/src/ApiClient.js b/src/ApiClient.js
index 26209636..dc2769d7 100644
--- a/src/ApiClient.js
+++ b/src/ApiClient.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import querystring from "querystring";
/**
* @module ApiClient
-* @version 1.0.3
+* @version 1.4.2
*/
/**
@@ -41,6 +41,7 @@ class ApiClient {
* @type {Array.}
*/
this.authentications = {
+ 'ApiToken': {type: 'apiKey', 'in': 'query', name: 'token'},
'OAuthSecurity': {type: 'oauth2'},
'OAuthToken': {type: 'apiKey', 'in': 'query', name: 'token'}
}
diff --git a/src/api/AnalyticsApi.js b/src/api/AnalyticsApi.js
index 60f42ee9..81c08b08 100644
--- a/src/api/AnalyticsApi.js
+++ b/src/api/AnalyticsApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -24,7 +24,7 @@ import InlineResponse20026 from '../model/InlineResponse20026';
/**
* Analytics service.
* @module api/AnalyticsApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class AnalyticsApi {
diff --git a/src/api/LibCalApi.js b/src/api/LibCalApi.js
new file mode 100644
index 00000000..432db1d0
--- /dev/null
+++ b/src/api/LibCalApi.js
@@ -0,0 +1,793 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+
+import ApiClient from "../ApiClient";
+import Error from '../model/Error';
+import InlineResponse20027 from '../model/InlineResponse20027';
+import InlineResponse20028 from '../model/InlineResponse20028';
+import InlineResponse20029 from '../model/InlineResponse20029';
+import InlineResponse20030 from '../model/InlineResponse20030';
+import InlineResponse20031 from '../model/InlineResponse20031';
+import InlineResponse20032 from '../model/InlineResponse20032';
+import InlineResponse20033 from '../model/InlineResponse20033';
+import InlineResponse20034 from '../model/InlineResponse20034';
+import InlineResponse20035 from '../model/InlineResponse20035';
+import InlineResponse20036 from '../model/InlineResponse20036';
+import InlineResponse20037 from '../model/InlineResponse20037';
+import InlineResponse20038 from '../model/InlineResponse20038';
+import InlineResponse20039 from '../model/InlineResponse20039';
+import InlineResponse20040 from '../model/InlineResponse20040';
+import InlineResponse20041 from '../model/InlineResponse20041';
+import InlineResponse20042 from '../model/InlineResponse20042';
+import LibcalReserveRequest from '../model/LibcalReserveRequest';
+
+/**
+* LibCal service.
+* @module api/LibCalApi
+* @version 1.4.2
+*/
+export default class LibCalApi {
+
+ /**
+ * Constructs a new LibCalApi.
+ * @alias module:api/LibCalApi
+ * @class
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
+ * default to {@link module:ApiClient#instance} if unspecified.
+ */
+ constructor(apiClient) {
+ this.apiClient = apiClient || ApiClient.instance;
+ }
+
+
+ /**
+ * Callback function to receive the result of the libcalSpaceBookingsGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceBookingsGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20039} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get all LibCal bookings
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.eid Comma delimited list of LibCal space IDs. If specified, will only show bookings for those spaces.
+ * @param {String} opts.seatId Comma delimited list of LibCal seat IDs. If specified, will only show bookings for those seats.
+ * @param {String} opts.cid Comma delimited list of LibCal category IDs. If specified, will only show bookings for those categories.
+ * @param {String} opts.lid Comma delimited list of LibCal location IDs. If specified, will only show bookings for those locations.
+ * @param {String} opts._date Date in YYYY-MM-DD format. If specified, will only show bookings made on this date. Dates in the past are ignored. Defaults to today's date.
+ * @param {Number} opts.days Number of days into the future to retrieve bookings from, starting from the data parameter. Defaults to zero. Must be >= 0 and <= 365.
+ * @param {Number} opts.limit Maximum number of bookings to return. Defaults to 20. The maximum value is 500.
+ * @param {module:api/LibCalApi~libcalSpaceBookingsGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20039}
+ */
+ libcalSpaceBookingsGet(opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'eid': opts['eid'],
+ 'seat_id': opts['seatId'],
+ 'cid': opts['cid'],
+ 'lid': opts['lid'],
+ 'date': opts['_date'],
+ 'days': opts['days'],
+ 'limit': opts['limit']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20039;
+ return this.apiClient.callApi(
+ '/libcal/space/bookings', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceCancelPost operation.
+ * @callback module:api/LibCalApi~libcalSpaceCancelPostCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20042} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Cancel one or more LibCal bookings
+ * @param {String} id A comma delimited list of LibCal booking IDs to cancel
+ * @param {module:api/LibCalApi~libcalSpaceCancelPostCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20042}
+ */
+ libcalSpaceCancelPost(id, callback) {
+ let postBody = null;
+ // verify the required parameter 'id' is set
+ if (id === undefined || id === null) {
+ throw new Error("Missing the required parameter 'id' when calling libcalSpaceCancelPost");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'id': id
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['OAuthSecurity', 'OAuthToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20042;
+ return this.apiClient.callApi(
+ '/libcal/space/cancel', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceCategoriesGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceCategoriesGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20028} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Returns the categories of spaces available in the given location(s)
+ * @param {String} ids Comma delimited list of LibCal location IDs
+ * @param {module:api/LibCalApi~libcalSpaceCategoriesGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20028}
+ */
+ libcalSpaceCategoriesGet(ids, callback) {
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceCategoriesGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20028;
+ return this.apiClient.callApi(
+ '/libcal/space/categories', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceCategoryGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceCategoryGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20029} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get all spaces corresponding to the specified categories
+ * @param {String} ids Comma delimited list of LibCal category IDs
+ * @param {Object} opts Optional parameters
+ * @param {Number} opts.details Flag to indicate you want additional details such as terms and conditions.
+ * @param {String} opts.availability Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+ * @param {module:api/LibCalApi~libcalSpaceCategoryGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20029}
+ */
+ libcalSpaceCategoryGet(ids, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceCategoryGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids,
+ 'details': opts['details'],
+ 'availability': opts['availability']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20029;
+ return this.apiClient.callApi(
+ '/libcal/space/category', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceFormGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceFormGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20030} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get all forms (including fields) corresponding to the given LibCal form ID(s)
+ * @param {String} ids Comma delimited list of LibCal form IDs
+ * @param {module:api/LibCalApi~libcalSpaceFormGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20030}
+ */
+ libcalSpaceFormGet(ids, callback) {
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceFormGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20030;
+ return this.apiClient.callApi(
+ '/libcal/space/form', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceItemGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceItemGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20032} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get the spaces corresponding to the given LibCal space ID(s)
+ * @param {String} ids Comma delimited list of LibCal space IDs
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.availability Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+ * @param {module:api/LibCalApi~libcalSpaceItemGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20032}
+ */
+ libcalSpaceItemGet(ids, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceItemGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids,
+ 'availability': opts['availability']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20032;
+ return this.apiClient.callApi(
+ '/libcal/space/item', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceLocationsGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceLocationsGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20027} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Gets all LibCal locations
+ * @param {Object} opts Optional parameters
+ * @param {Number} opts.details Flag to indicate you want additional details such as terms and conditions.
+ * @param {module:api/LibCalApi~libcalSpaceLocationsGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20027}
+ */
+ libcalSpaceLocationsGet(opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'details': opts['details']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20027;
+ return this.apiClient.callApi(
+ '/libcal/space/locations', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceNicknameGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceNicknameGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20033} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get the nicknames asssigned to certain LibCal bookings
+ * @param {String} ids Comma delimited list of LibCal category IDs
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.availability Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+ * @param {module:api/LibCalApi~libcalSpaceNicknameGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20033}
+ */
+ libcalSpaceNicknameGet(ids, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceNicknameGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids,
+ 'availability': opts['availability']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20033;
+ return this.apiClient.callApi(
+ '/libcal/space/nickname', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpacePersonalBookingsGet operation.
+ * @callback module:api/LibCalApi~libcalSpacePersonalBookingsGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20040} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get all LibCal bookings
+ * @param {String} clientSecret Client secret of the authenticating app.
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.eid Comma delimited list of LibCal space IDs. If specified, will only show bookings for those spaces.
+ * @param {String} opts.seatId Comma delimited list of LibCal seat IDs. If specified, will only show bookings for those seats.
+ * @param {String} opts.cid Comma delimited list of LibCal category IDs. If specified, will only show bookings for those categories.
+ * @param {String} opts.lid Comma delimited list of LibCal location IDs. If specified, will only show bookings for those locations.
+ * @param {String} opts.email If specified, will only show bookings made with this email address
+ * @param {String} opts._date Date in YYYY-MM-DD format. If specified, will only show bookings made on this date. Dates in the past are ignored. Defaults to today's date.
+ * @param {Number} opts.days Number of days into the future to retrieve bookings from, starting from the data parameter. Defaults to zero. Must be >= 0 and <= 365.
+ * @param {Number} opts.limit Maximum number of bookings to return. Defaults to 20. The maximum value is 500.
+ * @param {Boolean} opts.formAnswers Whether or not form answers should be returned. Defaults to false.
+ * @param {module:api/LibCalApi~libcalSpacePersonalBookingsGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20040}
+ */
+ libcalSpacePersonalBookingsGet(clientSecret, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'clientSecret' is set
+ if (clientSecret === undefined || clientSecret === null) {
+ throw new Error("Missing the required parameter 'clientSecret' when calling libcalSpacePersonalBookingsGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'client_secret': clientSecret,
+ 'eid': opts['eid'],
+ 'seat_id': opts['seatId'],
+ 'cid': opts['cid'],
+ 'lid': opts['lid'],
+ 'email': opts['email'],
+ 'date': opts['_date'],
+ 'days': opts['days'],
+ 'limit': opts['limit'],
+ 'form_answers': opts['formAnswers']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['OAuthSecurity', 'OAuthToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20040;
+ return this.apiClient.callApi(
+ '/libcal/space/personal_bookings', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceQuestionGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceQuestionGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20031} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get the questions corresponding to the given LibCal field/question ID(s)
+ * @param {String} ids Comma delimited list of LibCal field/question IDs
+ * @param {module:api/LibCalApi~libcalSpaceQuestionGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20031}
+ */
+ libcalSpaceQuestionGet(ids, callback) {
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceQuestionGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20031;
+ return this.apiClient.callApi(
+ '/libcal/space/question', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceReservePost operation.
+ * @callback module:api/LibCalApi~libcalSpaceReservePostCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20041} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Reserve one or more LibCal spaces/seats
+ * @param {module:model/LibcalReserveRequest} libcalReserveRequest
+ * @param {module:api/LibCalApi~libcalSpaceReservePostCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20041}
+ */
+ libcalSpaceReservePost(libcalReserveRequest, callback) {
+ let postBody = libcalReserveRequest;
+ // verify the required parameter 'libcalReserveRequest' is set
+ if (libcalReserveRequest === undefined || libcalReserveRequest === null) {
+ throw new Error("Missing the required parameter 'libcalReserveRequest' when calling libcalSpaceReservePost");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['OAuthSecurity', 'OAuthToken'];
+ let contentTypes = ['application/json'];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20041;
+ return this.apiClient.callApi(
+ '/libcal/space/reserve', 'POST',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceSeatGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceSeatGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20036} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get LibCal seat by ID
+ * @param {String} ids Comma delimited list of LibCal category IDs
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.availability Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+ * @param {module:api/LibCalApi~libcalSpaceSeatGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20036}
+ */
+ libcalSpaceSeatGet(ids, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceSeatGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids,
+ 'availability': opts['availability']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20036;
+ return this.apiClient.callApi(
+ '/libcal/space/seat', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceSeatsGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceSeatsGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20035} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get all LibCal seats in a given location
+ * @param {String} ids A single LibCal location ID
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.spaceId If specified, only return data for this space
+ * @param {String} opts.categoryId If specified, will only return data for that category
+ * @param {String} opts.seatId Show only the seat with this ID. If this is specified, spaceId, categoryId, and zoneId will be ignored.
+ * @param {Boolean} opts.accessibleOnly Return only acessible seats (i.e. seats with height-adjustable furniture).
+ * @param {String} opts.availability Either a single date or a comma delimited list of 2 dates (a start and end date). The keyword 'next' (alone) can also be used to return availability for the next date that this item is available. Setting this parameter also sets the details value to 1. Dates should be in YYYY-MM-DD format.
+ * @param {Number} opts.pageIndex For pagination purposes, this specifies the page to be retrieved. Starts at 0 for the first page.
+ * @param {Number} opts.pageSize For pagination purposes, this specifies the number of results per page. Must be >= 1 and <= 100. The default is 20.
+ * @param {module:api/LibCalApi~libcalSpaceSeatsGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20035}
+ */
+ libcalSpaceSeatsGet(ids, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceSeatsGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids,
+ 'space_id': opts['spaceId'],
+ 'category_id': opts['categoryId'],
+ 'seat_id': opts['seatId'],
+ 'accessible_only': opts['accessibleOnly'],
+ 'availability': opts['availability'],
+ 'page_index': opts['pageIndex'],
+ 'page_size': opts['pageSize']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20035;
+ return this.apiClient.callApi(
+ '/libcal/space/seats', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceUtilizationGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceUtilizationGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20034} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get utilisation stats for a particular location
+ * Optionally filter by categoryId and zoneId
+ * @param {String} ids A single LibCal location ID
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.categoryId If specified, will only return data for that category
+ * @param {String} opts.zoneId If specified, will only return data for that zone
+ * @param {module:api/LibCalApi~libcalSpaceUtilizationGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20034}
+ */
+ libcalSpaceUtilizationGet(ids, opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceUtilizationGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids,
+ 'category_id': opts['categoryId'],
+ 'zone_id': opts['zoneId']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20034;
+ return this.apiClient.callApi(
+ '/libcal/space/utilization', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceZoneGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceZoneGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20038} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get LibCal zone by ID
+ * @param {Object} opts Optional parameters
+ * @param {String} opts.zoneId If specified, will only return data for that zone
+ * @param {module:api/LibCalApi~libcalSpaceZoneGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20038}
+ */
+ libcalSpaceZoneGet(opts, callback) {
+ opts = opts || {};
+ let postBody = null;
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'zone_id': opts['zoneId']
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20038;
+ return this.apiClient.callApi(
+ '/libcal/space/zone', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+ /**
+ * Callback function to receive the result of the libcalSpaceZonesGet operation.
+ * @callback module:api/LibCalApi~libcalSpaceZonesGetCallback
+ * @param {String} error Error message, if any.
+ * @param {module:model/InlineResponse20037} data The data returned by the service call.
+ * @param {String} response The complete HTTP response.
+ */
+
+ /**
+ * Get LibCal zones by location
+ * @param {String} ids A single LibCal location ID
+ * @param {module:api/LibCalApi~libcalSpaceZonesGetCallback} callback The callback function, accepting three arguments: error, data, response
+ * data is of type: {@link module:model/InlineResponse20037}
+ */
+ libcalSpaceZonesGet(ids, callback) {
+ let postBody = null;
+ // verify the required parameter 'ids' is set
+ if (ids === undefined || ids === null) {
+ throw new Error("Missing the required parameter 'ids' when calling libcalSpaceZonesGet");
+ }
+
+ let pathParams = {
+ };
+ let queryParams = {
+ 'ids': ids
+ };
+ let headerParams = {
+ };
+ let formParams = {
+ };
+
+ let authNames = ['ApiToken'];
+ let contentTypes = [];
+ let accepts = ['application/json'];
+ let returnType = InlineResponse20037;
+ return this.apiClient.callApi(
+ '/libcal/space/zones', 'GET',
+ pathParams, queryParams, headerParams, formParams, postBody,
+ authNames, contentTypes, accepts, returnType, null, callback
+ );
+ }
+
+
+}
diff --git a/src/api/OAuthApi.js b/src/api/OAuthApi.js
index 523f095d..16bdb291 100644
--- a/src/api/OAuthApi.js
+++ b/src/api/OAuthApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -21,7 +21,7 @@ import UserData from '../model/UserData';
/**
* OAuth service.
* @module api/OAuthApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class OAuthApi {
diff --git a/src/api/ResourcesApi.js b/src/api/ResourcesApi.js
index 961cf92d..65a6d5d5 100644
--- a/src/api/ResourcesApi.js
+++ b/src/api/ResourcesApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,7 +19,7 @@ import InlineResponse20011 from '../model/InlineResponse20011';
/**
* Resources service.
* @module api/ResourcesApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class ResourcesApi {
diff --git a/src/api/RoomBookingsApi.js b/src/api/RoomBookingsApi.js
index 6d832e19..580f0d9b 100644
--- a/src/api/RoomBookingsApi.js
+++ b/src/api/RoomBookingsApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,7 +22,7 @@ import InlineResponse2009 from '../model/InlineResponse2009';
/**
* RoomBookings service.
* @module api/RoomBookingsApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class RoomBookingsApi {
diff --git a/src/api/SearchApi.js b/src/api/SearchApi.js
index 99c4b7b7..a64167de 100644
--- a/src/api/SearchApi.js
+++ b/src/api/SearchApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -19,7 +19,7 @@ import InlineResponse20010 from '../model/InlineResponse20010';
/**
* Search service.
* @module api/SearchApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class SearchApi {
diff --git a/src/api/TimetableApi.js b/src/api/TimetableApi.js
index da02af55..14cc7aca 100644
--- a/src/api/TimetableApi.js
+++ b/src/api/TimetableApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,7 +22,7 @@ import InlineResponse2003 from '../model/InlineResponse2003';
/**
* Timetable service.
* @module api/TimetableApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class TimetableApi {
diff --git a/src/api/WorkspacesApi.js b/src/api/WorkspacesApi.js
index 7c04185a..e3b4b63d 100644
--- a/src/api/WorkspacesApi.js
+++ b/src/api/WorkspacesApi.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,7 +28,7 @@ import Svg from '../model/Svg';
/**
* Workspaces service.
* @module api/WorkspacesApi
-* @version 1.0.3
+* @version 1.4.2
*/
export default class WorkspacesApi {
diff --git a/src/index.js b/src/index.js
index 0176d09d..1fff9334 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -53,8 +53,25 @@ import InlineResponse20024Data from './model/InlineResponse20024Data';
import InlineResponse20025 from './model/InlineResponse20025';
import InlineResponse20026 from './model/InlineResponse20026';
import InlineResponse20026Data from './model/InlineResponse20026Data';
+import InlineResponse20027 from './model/InlineResponse20027';
+import InlineResponse20028 from './model/InlineResponse20028';
+import InlineResponse20029 from './model/InlineResponse20029';
+import InlineResponse20029Categories from './model/InlineResponse20029Categories';
import InlineResponse2003 from './model/InlineResponse2003';
+import InlineResponse20030 from './model/InlineResponse20030';
+import InlineResponse20031 from './model/InlineResponse20031';
+import InlineResponse20032 from './model/InlineResponse20032';
+import InlineResponse20033 from './model/InlineResponse20033';
+import InlineResponse20034 from './model/InlineResponse20034';
+import InlineResponse20035 from './model/InlineResponse20035';
+import InlineResponse20036 from './model/InlineResponse20036';
+import InlineResponse20037 from './model/InlineResponse20037';
+import InlineResponse20038 from './model/InlineResponse20038';
+import InlineResponse20039 from './model/InlineResponse20039';
import InlineResponse2004 from './model/InlineResponse2004';
+import InlineResponse20040 from './model/InlineResponse20040';
+import InlineResponse20041 from './model/InlineResponse20041';
+import InlineResponse20042 from './model/InlineResponse20042';
import InlineResponse2005 from './model/InlineResponse2005';
import InlineResponse2006 from './model/InlineResponse2006';
import InlineResponse2007 from './model/InlineResponse2007';
@@ -62,6 +79,21 @@ import InlineResponse2008 from './model/InlineResponse2008';
import InlineResponse2009 from './model/InlineResponse2009';
import Instance from './model/Instance';
import Lecturer from './model/Lecturer';
+import LibcalBooking from './model/LibcalBooking';
+import LibcalCategory from './model/LibcalCategory';
+import LibcalForm from './model/LibcalForm';
+import LibcalFormField from './model/LibcalFormField';
+import LibcalLocation from './model/LibcalLocation';
+import LibcalLocationBase from './model/LibcalLocationBase';
+import LibcalPersonalSeatBooking from './model/LibcalPersonalSeatBooking';
+import LibcalReserveRequest from './model/LibcalReserveRequest';
+import LibcalReserveRequestBooking from './model/LibcalReserveRequestBooking';
+import LibcalSeat from './model/LibcalSeat';
+import LibcalSeatBooking from './model/LibcalSeatBooking';
+import LibcalSpaceBase from './model/LibcalSpaceBase';
+import LibcalUtilisationSeatSummary from './model/LibcalUtilisationSeatSummary';
+import LibcalUtilisationSpaceSummary from './model/LibcalUtilisationSpaceSummary';
+import LibcalZone from './model/LibcalZone';
import Location from './model/Location';
import LocationCoordinates from './model/LocationCoordinates';
import Map from './model/Map';
@@ -89,6 +121,7 @@ import TeachingPeriods from './model/TeachingPeriods';
import Timetable from './model/Timetable';
import UserData from './model/UserData';
import AnalyticsApi from './api/AnalyticsApi';
+import LibCalApi from './api/LibCalApi';
import OAuthApi from './api/OAuthApi';
import ResourcesApi from './api/ResourcesApi';
import RoomBookingsApi from './api/RoomBookingsApi';
@@ -126,7 +159,7 @@ import WorkspacesApi from './api/WorkspacesApi';
*
*
* @module index
-* @version 1.0.3
+* @version 1.4.2
*/
export {
/**
@@ -375,18 +408,120 @@ export {
*/
InlineResponse20026Data,
+ /**
+ * The InlineResponse20027 model constructor.
+ * @property {module:model/InlineResponse20027}
+ */
+ InlineResponse20027,
+
+ /**
+ * The InlineResponse20028 model constructor.
+ * @property {module:model/InlineResponse20028}
+ */
+ InlineResponse20028,
+
+ /**
+ * The InlineResponse20029 model constructor.
+ * @property {module:model/InlineResponse20029}
+ */
+ InlineResponse20029,
+
+ /**
+ * The InlineResponse20029Categories model constructor.
+ * @property {module:model/InlineResponse20029Categories}
+ */
+ InlineResponse20029Categories,
+
/**
* The InlineResponse2003 model constructor.
* @property {module:model/InlineResponse2003}
*/
InlineResponse2003,
+ /**
+ * The InlineResponse20030 model constructor.
+ * @property {module:model/InlineResponse20030}
+ */
+ InlineResponse20030,
+
+ /**
+ * The InlineResponse20031 model constructor.
+ * @property {module:model/InlineResponse20031}
+ */
+ InlineResponse20031,
+
+ /**
+ * The InlineResponse20032 model constructor.
+ * @property {module:model/InlineResponse20032}
+ */
+ InlineResponse20032,
+
+ /**
+ * The InlineResponse20033 model constructor.
+ * @property {module:model/InlineResponse20033}
+ */
+ InlineResponse20033,
+
+ /**
+ * The InlineResponse20034 model constructor.
+ * @property {module:model/InlineResponse20034}
+ */
+ InlineResponse20034,
+
+ /**
+ * The InlineResponse20035 model constructor.
+ * @property {module:model/InlineResponse20035}
+ */
+ InlineResponse20035,
+
+ /**
+ * The InlineResponse20036 model constructor.
+ * @property {module:model/InlineResponse20036}
+ */
+ InlineResponse20036,
+
+ /**
+ * The InlineResponse20037 model constructor.
+ * @property {module:model/InlineResponse20037}
+ */
+ InlineResponse20037,
+
+ /**
+ * The InlineResponse20038 model constructor.
+ * @property {module:model/InlineResponse20038}
+ */
+ InlineResponse20038,
+
+ /**
+ * The InlineResponse20039 model constructor.
+ * @property {module:model/InlineResponse20039}
+ */
+ InlineResponse20039,
+
/**
* The InlineResponse2004 model constructor.
* @property {module:model/InlineResponse2004}
*/
InlineResponse2004,
+ /**
+ * The InlineResponse20040 model constructor.
+ * @property {module:model/InlineResponse20040}
+ */
+ InlineResponse20040,
+
+ /**
+ * The InlineResponse20041 model constructor.
+ * @property {module:model/InlineResponse20041}
+ */
+ InlineResponse20041,
+
+ /**
+ * The InlineResponse20042 model constructor.
+ * @property {module:model/InlineResponse20042}
+ */
+ InlineResponse20042,
+
/**
* The InlineResponse2005 model constructor.
* @property {module:model/InlineResponse2005}
@@ -429,6 +564,96 @@ export {
*/
Lecturer,
+ /**
+ * The LibcalBooking model constructor.
+ * @property {module:model/LibcalBooking}
+ */
+ LibcalBooking,
+
+ /**
+ * The LibcalCategory model constructor.
+ * @property {module:model/LibcalCategory}
+ */
+ LibcalCategory,
+
+ /**
+ * The LibcalForm model constructor.
+ * @property {module:model/LibcalForm}
+ */
+ LibcalForm,
+
+ /**
+ * The LibcalFormField model constructor.
+ * @property {module:model/LibcalFormField}
+ */
+ LibcalFormField,
+
+ /**
+ * The LibcalLocation model constructor.
+ * @property {module:model/LibcalLocation}
+ */
+ LibcalLocation,
+
+ /**
+ * The LibcalLocationBase model constructor.
+ * @property {module:model/LibcalLocationBase}
+ */
+ LibcalLocationBase,
+
+ /**
+ * The LibcalPersonalSeatBooking model constructor.
+ * @property {module:model/LibcalPersonalSeatBooking}
+ */
+ LibcalPersonalSeatBooking,
+
+ /**
+ * The LibcalReserveRequest model constructor.
+ * @property {module:model/LibcalReserveRequest}
+ */
+ LibcalReserveRequest,
+
+ /**
+ * The LibcalReserveRequestBooking model constructor.
+ * @property {module:model/LibcalReserveRequestBooking}
+ */
+ LibcalReserveRequestBooking,
+
+ /**
+ * The LibcalSeat model constructor.
+ * @property {module:model/LibcalSeat}
+ */
+ LibcalSeat,
+
+ /**
+ * The LibcalSeatBooking model constructor.
+ * @property {module:model/LibcalSeatBooking}
+ */
+ LibcalSeatBooking,
+
+ /**
+ * The LibcalSpaceBase model constructor.
+ * @property {module:model/LibcalSpaceBase}
+ */
+ LibcalSpaceBase,
+
+ /**
+ * The LibcalUtilisationSeatSummary model constructor.
+ * @property {module:model/LibcalUtilisationSeatSummary}
+ */
+ LibcalUtilisationSeatSummary,
+
+ /**
+ * The LibcalUtilisationSpaceSummary model constructor.
+ * @property {module:model/LibcalUtilisationSpaceSummary}
+ */
+ LibcalUtilisationSpaceSummary,
+
+ /**
+ * The LibcalZone model constructor.
+ * @property {module:model/LibcalZone}
+ */
+ LibcalZone,
+
/**
* The Location model constructor.
* @property {module:model/Location}
@@ -591,6 +816,12 @@ export {
*/
AnalyticsApi,
+ /**
+ * The LibCalApi service constructor.
+ * @property {module:api/LibCalApi}
+ */
+ LibCalApi,
+
/**
* The OAuthApi service constructor.
* @property {module:api/OAuthApi}
diff --git a/src/model/Average.js b/src/model/Average.js
index 10ec687c..39acb3ac 100644
--- a/src/model/Average.js
+++ b/src/model/Average.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Average model module.
* @module model/Average
- * @version 1.0.3
+ * @version 1.4.2
*/
class Average {
/**
diff --git a/src/model/AverageWithNameAndId.js b/src/model/AverageWithNameAndId.js
index 4e354d13..ba4502b5 100644
--- a/src/model/AverageWithNameAndId.js
+++ b/src/model/AverageWithNameAndId.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The AverageWithNameAndId model module.
* @module model/AverageWithNameAndId
- * @version 1.0.3
+ * @version 1.4.2
*/
class AverageWithNameAndId {
/**
diff --git a/src/model/Booking.js b/src/model/Booking.js
index d077dd9a..f9e44d0e 100644
--- a/src/model/Booking.js
+++ b/src/model/Booking.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Booking model module.
* @module model/Booking
- * @version 1.0.3
+ * @version 1.4.2
*/
class Booking {
/**
diff --git a/src/model/Course.js b/src/model/Course.js
index b6ad9939..beb6676c 100644
--- a/src/model/Course.js
+++ b/src/model/Course.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Course model module.
* @module model/Course
- * @version 1.0.3
+ * @version 1.4.2
*/
class Course {
/**
diff --git a/src/model/Delivery.js b/src/model/Delivery.js
index eee2efb9..5322561e 100644
--- a/src/model/Delivery.js
+++ b/src/model/Delivery.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Delivery model module.
* @module model/Delivery
- * @version 1.0.3
+ * @version 1.4.2
*/
class Delivery {
/**
diff --git a/src/model/Department.js b/src/model/Department.js
index 70d2dc66..b0952c32 100644
--- a/src/model/Department.js
+++ b/src/model/Department.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Department model module.
* @module model/Department
- * @version 1.0.3
+ * @version 1.4.2
*/
class Department {
/**
diff --git a/src/model/DesktopData.js b/src/model/DesktopData.js
index 4b1d847d..da4796aa 100644
--- a/src/model/DesktopData.js
+++ b/src/model/DesktopData.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import DesktopDataLocation from './DesktopDataLocation';
/**
* The DesktopData model module.
* @module model/DesktopData
- * @version 1.0.3
+ * @version 1.4.2
*/
class DesktopData {
/**
diff --git a/src/model/DesktopDataLocation.js b/src/model/DesktopDataLocation.js
index e34504d6..3fe520f5 100644
--- a/src/model/DesktopDataLocation.js
+++ b/src/model/DesktopDataLocation.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The DesktopDataLocation model module.
* @module model/DesktopDataLocation
- * @version 1.0.3
+ * @version 1.4.2
*/
class DesktopDataLocation {
/**
diff --git a/src/model/Equipment.js b/src/model/Equipment.js
index d29eea9a..cb0dc26d 100644
--- a/src/model/Equipment.js
+++ b/src/model/Equipment.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Equipment model module.
* @module model/Equipment
- * @version 1.0.3
+ * @version 1.4.2
*/
class Equipment {
/**
diff --git a/src/model/Error.js b/src/model/Error.js
index 109682e2..2f41ef46 100644
--- a/src/model/Error.js
+++ b/src/model/Error.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The Error model module.
* @module model/Error
- * @version 1.0.3
+ * @version 1.4.2
*/
class Error {
/**
diff --git a/src/model/Event.js b/src/model/Event.js
index 0fbba2a4..1a9f2459 100644
--- a/src/model/Event.js
+++ b/src/model/Event.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -18,7 +18,7 @@ import Module from './Module';
/**
* The Event model module.
* @module model/Event
- * @version 1.0.3
+ * @version 1.4.2
*/
class Event {
/**
diff --git a/src/model/HistoricalSensor.js b/src/model/HistoricalSensor.js
index 0e952c69..9d5c4186 100644
--- a/src/model/HistoricalSensor.js
+++ b/src/model/HistoricalSensor.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The HistoricalSensor model module.
* @module model/HistoricalSensor
- * @version 1.0.3
+ * @version 1.4.2
*/
class HistoricalSensor {
/**
diff --git a/src/model/HistoricalSurvey.js b/src/model/HistoricalSurvey.js
index 752e2be7..e02dce78 100644
--- a/src/model/HistoricalSurvey.js
+++ b/src/model/HistoricalSurvey.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The HistoricalSurvey model module.
* @module model/HistoricalSurvey
- * @version 1.0.3
+ * @version 1.4.2
*/
class HistoricalSurvey {
/**
diff --git a/src/model/HistoricalSurveyData.js b/src/model/HistoricalSurveyData.js
index c1933e2e..d2f4f408 100644
--- a/src/model/HistoricalSurveyData.js
+++ b/src/model/HistoricalSurveyData.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The HistoricalSurveyData model module.
* @module model/HistoricalSurveyData
- * @version 1.0.3
+ * @version 1.4.2
*/
class HistoricalSurveyData {
/**
diff --git a/src/model/InlineResponse200.js b/src/model/InlineResponse200.js
index fb224d75..62a4b1d3 100644
--- a/src/model/InlineResponse200.js
+++ b/src/model/InlineResponse200.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import Timetable from './Timetable';
/**
* The InlineResponse200 model module.
* @module model/InlineResponse200
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse200 {
/**
diff --git a/src/model/InlineResponse2001.js b/src/model/InlineResponse2001.js
index 650636d9..c43d4ab2 100644
--- a/src/model/InlineResponse2001.js
+++ b/src/model/InlineResponse2001.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import Department from './Department';
/**
* The InlineResponse2001 model module.
* @module model/InlineResponse2001
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse2001 {
/**
diff --git a/src/model/InlineResponse20010.js b/src/model/InlineResponse20010.js
index 1ab9ae0e..bdfcaaaf 100644
--- a/src/model/InlineResponse20010.js
+++ b/src/model/InlineResponse20010.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import Person from './Person';
/**
* The InlineResponse20010 model module.
* @module model/InlineResponse20010
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20010 {
/**
diff --git a/src/model/InlineResponse20011.js b/src/model/InlineResponse20011.js
index 70a77ede..ae21a352 100644
--- a/src/model/InlineResponse20011.js
+++ b/src/model/InlineResponse20011.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import DesktopData from './DesktopData';
/**
* The InlineResponse20011 model module.
* @module model/InlineResponse20011
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20011 {
/**
diff --git a/src/model/InlineResponse20012.js b/src/model/InlineResponse20012.js
index e9dad306..2d28ce9f 100644
--- a/src/model/InlineResponse20012.js
+++ b/src/model/InlineResponse20012.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import Survey from './Survey';
/**
* The InlineResponse20012 model module.
* @module model/InlineResponse20012
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20012 {
/**
diff --git a/src/model/InlineResponse20013.js b/src/model/InlineResponse20013.js
index faae97b4..f12926a8 100644
--- a/src/model/InlineResponse20013.js
+++ b/src/model/InlineResponse20013.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import MapWithSensors from './MapWithSensors';
/**
* The InlineResponse20013 model module.
* @module model/InlineResponse20013
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20013 {
/**
diff --git a/src/model/InlineResponse20014.js b/src/model/InlineResponse20014.js
index d7967988..2f125ca2 100644
--- a/src/model/InlineResponse20014.js
+++ b/src/model/InlineResponse20014.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import SensorAverageSurvey from './SensorAverageSurvey';
/**
* The InlineResponse20014 model module.
* @module model/InlineResponse20014
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20014 {
/**
diff --git a/src/model/InlineResponse20015.js b/src/model/InlineResponse20015.js
index 97329fdc..14ff03f0 100644
--- a/src/model/InlineResponse20015.js
+++ b/src/model/InlineResponse20015.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20015 model module.
* @module model/InlineResponse20015
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20015 {
/**
diff --git a/src/model/InlineResponse20016.js b/src/model/InlineResponse20016.js
index 6a10a6b9..5cff0d6e 100644
--- a/src/model/InlineResponse20016.js
+++ b/src/model/InlineResponse20016.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import SurveyWithMaps from './SurveyWithMaps';
/**
* The InlineResponse20016 model module.
* @module model/InlineResponse20016
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20016 {
/**
diff --git a/src/model/InlineResponse20017.js b/src/model/InlineResponse20017.js
index 29bec805..cfe23541 100644
--- a/src/model/InlineResponse20017.js
+++ b/src/model/InlineResponse20017.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20017 model module.
* @module model/InlineResponse20017
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20017 {
/**
diff --git a/src/model/InlineResponse20018.js b/src/model/InlineResponse20018.js
index 6b11ceb5..1323a21d 100644
--- a/src/model/InlineResponse20018.js
+++ b/src/model/InlineResponse20018.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import InlineResponse20018Data from './InlineResponse20018Data';
/**
* The InlineResponse20018 model module.
* @module model/InlineResponse20018
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20018 {
/**
diff --git a/src/model/InlineResponse20018Data.js b/src/model/InlineResponse20018Data.js
index 58bea443..40c1855b 100644
--- a/src/model/InlineResponse20018Data.js
+++ b/src/model/InlineResponse20018Data.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import HistoricalSurveyData from './HistoricalSurveyData';
/**
* The InlineResponse20018Data model module.
* @module model/InlineResponse20018Data
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20018Data {
/**
diff --git a/src/model/InlineResponse20019.js b/src/model/InlineResponse20019.js
index 36d66827..fa0441c7 100644
--- a/src/model/InlineResponse20019.js
+++ b/src/model/InlineResponse20019.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import InlineResponse20019Data from './InlineResponse20019Data';
/**
* The InlineResponse20019 model module.
* @module model/InlineResponse20019
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20019 {
/**
diff --git a/src/model/InlineResponse20019Data.js b/src/model/InlineResponse20019Data.js
index 2dd26ef4..1c4fe343 100644
--- a/src/model/InlineResponse20019Data.js
+++ b/src/model/InlineResponse20019Data.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import HistoricalSensor from './HistoricalSensor';
/**
* The InlineResponse20019Data model module.
* @module model/InlineResponse20019Data
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20019Data {
/**
diff --git a/src/model/InlineResponse2002.js b/src/model/InlineResponse2002.js
index b67b0a71..826ff910 100644
--- a/src/model/InlineResponse2002.js
+++ b/src/model/InlineResponse2002.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import ModuleDataCoursesModules from './ModuleDataCoursesModules';
/**
* The InlineResponse2002 model module.
* @module model/InlineResponse2002
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse2002 {
/**
diff --git a/src/model/InlineResponse20020.js b/src/model/InlineResponse20020.js
index d087dddd..2b80a1a6 100644
--- a/src/model/InlineResponse20020.js
+++ b/src/model/InlineResponse20020.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import InlineResponse20020Surveys from './InlineResponse20020Surveys';
/**
* The InlineResponse20020 model module.
* @module model/InlineResponse20020
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20020 {
/**
diff --git a/src/model/InlineResponse20020Surveys.js b/src/model/InlineResponse20020Surveys.js
index aaa820a7..4e78a91e 100644
--- a/src/model/InlineResponse20020Surveys.js
+++ b/src/model/InlineResponse20020Surveys.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import HistoricalSurvey from './HistoricalSurvey';
/**
* The InlineResponse20020Surveys model module.
* @module model/InlineResponse20020Surveys
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20020Surveys {
/**
diff --git a/src/model/InlineResponse20021.js b/src/model/InlineResponse20021.js
index dab13236..42af3628 100644
--- a/src/model/InlineResponse20021.js
+++ b/src/model/InlineResponse20021.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20021 model module.
* @module model/InlineResponse20021
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20021 {
/**
diff --git a/src/model/InlineResponse20022.js b/src/model/InlineResponse20022.js
index d9db6857..dc6f8d12 100644
--- a/src/model/InlineResponse20022.js
+++ b/src/model/InlineResponse20022.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20022 model module.
* @module model/InlineResponse20022
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20022 {
/**
diff --git a/src/model/InlineResponse20023.js b/src/model/InlineResponse20023.js
index 03957714..9179ef04 100644
--- a/src/model/InlineResponse20023.js
+++ b/src/model/InlineResponse20023.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import InlineResponse20023Data from './InlineResponse20023Data';
/**
* The InlineResponse20023 model module.
* @module model/InlineResponse20023
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20023 {
/**
diff --git a/src/model/InlineResponse20023Data.js b/src/model/InlineResponse20023Data.js
index d27f1a2f..1696c205 100644
--- a/src/model/InlineResponse20023Data.js
+++ b/src/model/InlineResponse20023Data.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20023Data model module.
* @module model/InlineResponse20023Data
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20023Data {
/**
diff --git a/src/model/InlineResponse20024.js b/src/model/InlineResponse20024.js
index 2a66c070..dd9878d9 100644
--- a/src/model/InlineResponse20024.js
+++ b/src/model/InlineResponse20024.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import InlineResponse20024Data from './InlineResponse20024Data';
/**
* The InlineResponse20024 model module.
* @module model/InlineResponse20024
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20024 {
/**
diff --git a/src/model/InlineResponse20024Data.js b/src/model/InlineResponse20024Data.js
index 9e11f5a7..004fc1ee 100644
--- a/src/model/InlineResponse20024Data.js
+++ b/src/model/InlineResponse20024Data.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20024Data model module.
* @module model/InlineResponse20024Data
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20024Data {
/**
diff --git a/src/model/InlineResponse20025.js b/src/model/InlineResponse20025.js
index 8e9aa34c..abb23cf6 100644
--- a/src/model/InlineResponse20025.js
+++ b/src/model/InlineResponse20025.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20025 model module.
* @module model/InlineResponse20025
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20025 {
/**
diff --git a/src/model/InlineResponse20026.js b/src/model/InlineResponse20026.js
index 49d73ffb..e9bf1b35 100644
--- a/src/model/InlineResponse20026.js
+++ b/src/model/InlineResponse20026.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import InlineResponse20026Data from './InlineResponse20026Data';
/**
* The InlineResponse20026 model module.
* @module model/InlineResponse20026
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20026 {
/**
diff --git a/src/model/InlineResponse20026Data.js b/src/model/InlineResponse20026Data.js
index 7562fb9e..61d8a3ac 100644
--- a/src/model/InlineResponse20026Data.js
+++ b/src/model/InlineResponse20026Data.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -16,7 +16,7 @@ import ApiClient from '../ApiClient';
/**
* The InlineResponse20026Data model module.
* @module model/InlineResponse20026Data
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse20026Data {
/**
diff --git a/src/model/InlineResponse20027.js b/src/model/InlineResponse20027.js
new file mode 100644
index 00000000..47f85496
--- /dev/null
+++ b/src/model/InlineResponse20027.js
@@ -0,0 +1,80 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import LibcalLocation from './LibcalLocation';
+
+/**
+ * The InlineResponse20027 model module.
+ * @module model/InlineResponse20027
+ * @version 1.4.2
+ */
+class InlineResponse20027 {
+ /**
+ * Constructs a new InlineResponse20027.
+ * @alias module:model/InlineResponse20027
+ */
+ constructor() {
+
+ InlineResponse20027.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20027 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20027} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20027} The populated InlineResponse20027 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20027();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('data')) {
+ obj['data'] = ApiClient.convertToType(data['data'], [LibcalLocation]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20027.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.} data
+ */
+InlineResponse20027.prototype['data'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20027;
+
diff --git a/src/model/InlineResponse20028.js b/src/model/InlineResponse20028.js
new file mode 100644
index 00000000..51e9e1e5
--- /dev/null
+++ b/src/model/InlineResponse20028.js
@@ -0,0 +1,80 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import LibcalLocationBase from './LibcalLocationBase';
+
+/**
+ * The InlineResponse20028 model module.
+ * @module model/InlineResponse20028
+ * @version 1.4.2
+ */
+class InlineResponse20028 {
+ /**
+ * Constructs a new InlineResponse20028.
+ * @alias module:model/InlineResponse20028
+ */
+ constructor() {
+
+ InlineResponse20028.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20028 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20028} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20028} The populated InlineResponse20028 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20028();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('categories')) {
+ obj['categories'] = ApiClient.convertToType(data['categories'], [LibcalLocationBase]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20028.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.} categories
+ */
+InlineResponse20028.prototype['categories'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20028;
+
diff --git a/src/model/InlineResponse20029.js b/src/model/InlineResponse20029.js
new file mode 100644
index 00000000..c0fe25fd
--- /dev/null
+++ b/src/model/InlineResponse20029.js
@@ -0,0 +1,80 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import InlineResponse20029Categories from './InlineResponse20029Categories';
+
+/**
+ * The InlineResponse20029 model module.
+ * @module model/InlineResponse20029
+ * @version 1.4.2
+ */
+class InlineResponse20029 {
+ /**
+ * Constructs a new InlineResponse20029.
+ * @alias module:model/InlineResponse20029
+ */
+ constructor() {
+
+ InlineResponse20029.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20029 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20029} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20029} The populated InlineResponse20029 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20029();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('categories')) {
+ obj['categories'] = ApiClient.convertToType(data['categories'], [InlineResponse20029Categories]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20029.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.} categories
+ */
+InlineResponse20029.prototype['categories'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20029;
+
diff --git a/src/model/InlineResponse20029Categories.js b/src/model/InlineResponse20029Categories.js
new file mode 100644
index 00000000..9c83c2e8
--- /dev/null
+++ b/src/model/InlineResponse20029Categories.js
@@ -0,0 +1,98 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+
+/**
+ * The InlineResponse20029Categories model module.
+ * @module model/InlineResponse20029Categories
+ * @version 1.4.2
+ */
+class InlineResponse20029Categories {
+ /**
+ * Constructs a new InlineResponse20029Categories.
+ * @alias module:model/InlineResponse20029Categories
+ */
+ constructor() {
+
+ InlineResponse20029Categories.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20029Categories from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20029Categories} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20029Categories} The populated InlineResponse20029Categories instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20029Categories();
+
+ if (data.hasOwnProperty('cid')) {
+ obj['cid'] = ApiClient.convertToType(data['cid'], 'Number');
+ }
+ if (data.hasOwnProperty('formid')) {
+ obj['formid'] = ApiClient.convertToType(data['formid'], 'Number');
+ }
+ if (data.hasOwnProperty('public')) {
+ obj['public'] = ApiClient.convertToType(data['public'], 'Number');
+ }
+ if (data.hasOwnProperty('items')) {
+ obj['items'] = ApiClient.convertToType(data['items'], ['Number']);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * LibCal category ID denoting a category assigned to a particular space
+ * @member {Number} cid
+ */
+InlineResponse20029Categories.prototype['cid'] = undefined;
+
+/**
+ * LibCal booking form ID
+ * @member {Number} formid
+ */
+InlineResponse20029Categories.prototype['formid'] = undefined;
+
+/**
+ * 1 if the category of spaces is publicly-bookable, 0 if it is not
+ * @member {Number} public
+ */
+InlineResponse20029Categories.prototype['public'] = undefined;
+
+/**
+ * @member {Array.} items
+ */
+InlineResponse20029Categories.prototype['items'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20029Categories;
+
diff --git a/src/model/InlineResponse2003.js b/src/model/InlineResponse2003.js
index bd7d064f..7b97542f 100644
--- a/src/model/InlineResponse2003.js
+++ b/src/model/InlineResponse2003.js
@@ -2,7 +2,7 @@
* UCL API
* An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
*
- * The version of the OpenAPI document: 1.0.3
+ * The version of the OpenAPI document: 1.4.2
* Contact: isd.apiteam@ucl.ac.uk
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -17,7 +17,7 @@ import Course from './Course';
/**
* The InlineResponse2003 model module.
* @module model/InlineResponse2003
- * @version 1.0.3
+ * @version 1.4.2
*/
class InlineResponse2003 {
/**
diff --git a/src/model/InlineResponse20030.js b/src/model/InlineResponse20030.js
new file mode 100644
index 00000000..c868522f
--- /dev/null
+++ b/src/model/InlineResponse20030.js
@@ -0,0 +1,80 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import LibcalForm from './LibcalForm';
+
+/**
+ * The InlineResponse20030 model module.
+ * @module model/InlineResponse20030
+ * @version 1.4.2
+ */
+class InlineResponse20030 {
+ /**
+ * Constructs a new InlineResponse20030.
+ * @alias module:model/InlineResponse20030
+ */
+ constructor() {
+
+ InlineResponse20030.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20030 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20030} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20030} The populated InlineResponse20030 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20030();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('forms')) {
+ obj['forms'] = ApiClient.convertToType(data['forms'], [LibcalForm]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20030.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.} forms
+ */
+InlineResponse20030.prototype['forms'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20030;
+
diff --git a/src/model/InlineResponse20031.js b/src/model/InlineResponse20031.js
new file mode 100644
index 00000000..2dadcbaa
--- /dev/null
+++ b/src/model/InlineResponse20031.js
@@ -0,0 +1,80 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import LibcalFormField from './LibcalFormField';
+
+/**
+ * The InlineResponse20031 model module.
+ * @module model/InlineResponse20031
+ * @version 1.4.2
+ */
+class InlineResponse20031 {
+ /**
+ * Constructs a new InlineResponse20031.
+ * @alias module:model/InlineResponse20031
+ */
+ constructor() {
+
+ InlineResponse20031.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20031 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20031} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20031} The populated InlineResponse20031 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20031();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('questions')) {
+ obj['questions'] = ApiClient.convertToType(data['questions'], [LibcalFormField]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20031.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.} questions
+ */
+InlineResponse20031.prototype['questions'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20031;
+
diff --git a/src/model/InlineResponse20032.js b/src/model/InlineResponse20032.js
new file mode 100644
index 00000000..e1a85f0e
--- /dev/null
+++ b/src/model/InlineResponse20032.js
@@ -0,0 +1,80 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+import LibcalSpaceBase from './LibcalSpaceBase';
+
+/**
+ * The InlineResponse20032 model module.
+ * @module model/InlineResponse20032
+ * @version 1.4.2
+ */
+class InlineResponse20032 {
+ /**
+ * Constructs a new InlineResponse20032.
+ * @alias module:model/InlineResponse20032
+ */
+ constructor() {
+
+ InlineResponse20032.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20032 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20032} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20032} The populated InlineResponse20032 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20032();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('questions')) {
+ obj['questions'] = ApiClient.convertToType(data['questions'], [LibcalSpaceBase]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20032.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.} questions
+ */
+InlineResponse20032.prototype['questions'] = undefined;
+
+
+
+
+
+
+export default InlineResponse20032;
+
diff --git a/src/model/InlineResponse20033.js b/src/model/InlineResponse20033.js
new file mode 100644
index 00000000..52c06796
--- /dev/null
+++ b/src/model/InlineResponse20033.js
@@ -0,0 +1,79 @@
+/**
+ * UCL API
+ * An API generated by a team of student developers to interact with student and university data at UCL. The API is made up of several services, each of which will be separately explained. Every service will be documented here with important information, tips and examples. ## Get Your API Key Before you can use the API you should head to the API Dashboard and sign up using your UCL user account. Once logged into the dashboard simply name your app and you’ll be given a key that you can use to access all the services. Simple! ## API Rate Limits Rate limiting of the API is primarily on a per-user basis. The limit is calculated against the user, across all their access tokens. The limit is 10,000 requests per day and resets every day at midnight, London time. When a request is throttled, the response returned by the server has HTTP Status Code “429 Too Many Requests”. It includes a Retry-After header with the number of seconds the client is throttled for. If you would like your rate limit to be increased, contact us at isd.apiteam@ucl.ac.uk ## API Data Freshness Much of the data available from the API is served from cache. Bookings and Timetable data are updated every twenty minutes from UCL, and we update the [Library Study Spaces (Workspaces) API](https://uclapi.com/docs/#workspaces) every two minutes. The `Last-Modified` header will provide the time that the most recent caching operation completed in [RFC 2616](https://stackoverflow.com/a/21121453) format. Endpoints that do not rely on cached data will return the current timestamp in this field instead. This allows your application to judge whether the data is stale, or might need refreshing. For example, if a booking is added to the database and the data you are using is more than twenty minutes old, it may be that the booking is not visible to you yet. Consider creating a fresh request in this case. If you notice that the `Last-Modified` timestamp you see is unreasonably old, please [get in contact with us](mailto:isd.apiteam@ucl.ac.uk) ASAP to report this as it may indicate very stale data and an issue at our end. ## OAuth OAuth is a protocol that lets external apps request secure access to private UCL account data without getting your password. This can be done with a \"Sign In With UCL\" button on your website or app which saves UCL users the trouble of registering a new account with you. It also allows your app or website to retrieve a user's personal timetable. Check out a JS web app demo [here](https://uclapi-oauth-demo.glitch.me/). The source code for the demo is available [here](https://glitch.com/edit/#!/uclapi-oauth-demo). For an example of a mobile app implementation, check out [UCL Assistant](https://github.com/uclapi/ucl-assistant-app) (written in React Native) and the accompanying [UCL Assistant API backend](https://github.com/uclapi/ucl-assistant-api/tree/master/src/oauth) (written in Node.JS). ### Sign In With UCL Button If you want to add a \"Sign In With UCL\" button to your site, which looks like this: you can copy the following the code below and replace CLIENT_ID and STATE by the `client_id` of your app and a random `state`: ``` ``` ### Scopes OAuth scopes specify what access your app needs to a UCL user’s account. As an app developer, you set the desired scopes in the API Dashboard. When a user is responding to your authorisation request, the requested scopes will be displayed to the user. ### OAuth Workflow If your application uses OAuth, you must set a callback URL in the dashboard. Then the app should follow this procedure: 1. Redirect the user to `https://uclapi.com/oauth/authorise` with `state` and the application’s `client_id` as query parameters. 2. The user logs in with their UCL credentials on the UCL Single Sign-on website (if not logged in already). 3. The user reviews the OAuth scopes requested and either authorises or denies the application's request. If the application is authorised, the callback URL receives `client_id`, `state` (specified in 1.), `result`, and `code`. If the application is denied, the callback URL receives `result` and `state`, and no private data will be provided to the application. 4. To obtain a OAuth user token (necessary for retrieving personal data and certain API endpoints), we require `code` (from 3.), `client_id`, and `client_secret`. These should then be sent to `https://uclapi.com/oauth/token`, which will return a response containing `state`, `ok`, `client_id`, `token` (OAuth user token), and `scope` (OAuth scopes the app can access on the user’s behalf). **Note**: OAuth tokens and general API tokes are different. Whilst general API tokens can be used for all non-personal, generic data (such as room bookings), OAuth tokens must be used with an app's client_secret in order to retrieve personal data for a user. To make things easier, you can use personal OAuth tokens in place of general tokens once a user has logged into your app to retrieve generic data too. ### Tokens Tokens uniquely identify an app that is requesting data from the API. Tokens are a long string variable of numbers and letters. e.g. `uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb`. There are two different kinds of tokens you can work with: 1. Generic Tokens: These are tokens that are used to request non-personal data. These tokens are used between applications and the API to request any sort of data that the app may need that is not tied to a specific student. For example, UCL API’s Room booking service uses tokens to return information about rooms - when they are booked and which UCL rooms are free. 2. OAuth Tokens: This type of token is used when an app requires personal data from users. One of the most common uses of this type of token is when you sign in via UCL on an app. The app will then use a token to request a user’s personal data such as: - Department - Email - Full name - Given name - UPI - If they are a student or not - Student number (*note:* to get this, you need to tick the relevant scope in the dashboard before a user logs in; more on scopes above). Note that you can also use OAuth Tokens to access all the same data that generic app tokens can access. Each token is uniquely generated for each user logging into each app. Please note, access to any of this data needs to be approved by the user first. To use this type of token for your app, you need to redirect the user to the \"Authorise\" endpoint at: `https://uclapi.com/oauth/authorise` which can be done directly or by including a “Sign in With UCL Button” in your app, such as the one provided below, which links users to the authorisation endpoint with your app’s Client ID (accessible via the dashboard) and a random state number included in the GET parameters. The users then sign in with their UCL credentials and, if they authorise your app to use their personal data, a token will be generated which your app can use to get user’s personal data in JSON format from the oauth/user/data. Your application will receive the token at the callback URL you provided in the [Dashboard](https://uclapi.com/dashboard). ## Code Samples After authorisation, calling most of the API endpoints will be fairly similar to each other. Authorisation code samples are provided in their respective descriptions. In addition, please find short code examples of how you might call the `/roombookings/equipment` endpoint in your own code (you will find that only the request parameters will change between most different endpoints): Python: ```python import requests params = { \"token\": \"uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb\", \"roomid\": \"433\" \"siteid\": \"086\" } r = requests.get(\"https://uclapi.com/roombookings/equipment\", params=params) print(r.json()) ``` Shell: ```shell curl -G https://uclapi.com/roombookings/equipment -d token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb -d roomid=433 -d siteid=086 ``` JavaScript: ```js fetch(\"https://uclapi.com/roombookings/equipment?token=uclapi-5d58c3c4e6bf9c-c2910ad3b6e054-7ef60f44f1c14f-a05147bfd17fdb&roomid=433&siteid=086\") .then(response => response.json()) .then(json => console.log(json)); ```
+ *
+ * The version of the OpenAPI document: 1.4.2
+ * Contact: isd.apiteam@ucl.ac.uk
+ *
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ *
+ */
+
+import ApiClient from '../ApiClient';
+
+/**
+ * The InlineResponse20033 model module.
+ * @module model/InlineResponse20033
+ * @version 1.4.2
+ */
+class InlineResponse20033 {
+ /**
+ * Constructs a new InlineResponse20033.
+ * @alias module:model/InlineResponse20033
+ */
+ constructor() {
+
+ InlineResponse20033.initialize(this);
+ }
+
+ /**
+ * Initializes the fields of this object.
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
+ * Only for internal use.
+ */
+ static initialize(obj) {
+ }
+
+ /**
+ * Constructs a InlineResponse20033 from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data to obj if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/InlineResponse20033} obj Optional instance to populate.
+ * @return {module:model/InlineResponse20033} The populated InlineResponse20033 instance.
+ */
+ static constructFromObject(data, obj) {
+ if (data) {
+ obj = obj || new InlineResponse20033();
+
+ if (data.hasOwnProperty('ok')) {
+ obj['ok'] = ApiClient.convertToType(data['ok'], 'Boolean');
+ }
+ if (data.hasOwnProperty('categories')) {
+ obj['categories'] = ApiClient.convertToType(data['categories'], [Object]);
+ }
+ }
+ return obj;
+ }
+
+
+}
+
+/**
+ * @member {Boolean} ok
+ */
+InlineResponse20033.prototype['ok'] = undefined;
+
+/**
+ * @member {Array.