This API provides management of events for Oregon State University. It also allows for retrieval of event types, event topics, locations, counties, campuses, departments, and audiences.
This section will provide a basic description of all endpoints. For a more detailed blueprint of this API, please see the swagger specification.
Gets all events.
Gets a single event by its ID.
Gets all event types.
Gets a single event type by its ID.
Gets all event topics.
Gets a single event topic by its ID.
Gets a paginated list of locations. Page number and size can be passed as parameters.
Gets a single location by its ID.
Gets all counties.
Gets a single county by its ID.
Gets a paginated list of campuses. Page number and size can be passed as parameters.
Gets a single campus by its ID.
Gets a paginated list of departments. Page number and size can be passed as parameters.
Gets a single department by its ID.
Gets all audiences.
Gets a single audience by its ID.
Creates an event specified by a result object in the body of a request. Since an ID will be generated by the server, the id
field is not required and any value in this field will be ignored.
Valid example of body:
{
"data": {
"id": "null",
"type": "events",
"attributes": {
"title": "Example Event",
"description": "This is an example event.",
"locationID": null,
"otherLocationName": "Alternate location name",
"room": "Example room",
"address": "Example address",
"city": "Corvallis",
"state": "Oregon",
"countyIDs": null,
"campusID": null,
"eventURL": "www.eventurl.com",
"photoURL": "http://communications.oregonstate.edu/sites/communications.oregonstate.edu/files/beaverlogo_primary_v4.png",
"ticketURL": "www.ticketurl.com",
"ticketCost": "$100",
"hashtag": "examplehashtag",
"keywords": null,
"tags": null,
"allowsReviews": false,
"allowUserActivity": true,
"departmentIDs": null,
"contactName": "Contact Name",
"contactEmail": "contact@contact.com",
"contactPhone": "111-111-1111",
"eventTypeIDs": null,
"eventTopicIDs": null,
"audienceIDs": null,
"visibility": null,
"instances": [
{
"start": "2018-12-02T21:15:00Z",
"end": "2018-12-02T21:30:00Z"
},
{
"start": "2018-12-04T00:15:00Z",
"end": "2018-12-04T00:30:00Z"
}
]
}
}
}
Updates an event specified by its ID in the path and a result object in the body of the request. Since the ID of the event will not change, the id
field is not required and any value in this field will be ignored. The body of a PUT request should follow the same format as the body of a POST request
Deletes an event specified by its ID.
This API maintains a local cache of custom data from the vendor calendar system. The cache should be updated on a regular basis to ensure the data validation specific to the /events resources is accurate. Doing a PUT request to these endpoints will update their respective cache.
- Custom Fields /cache/update/customfields
- Departments /cache/update/departments
- Filters /cache/update/filters
- Groups /cache/update/groups
- Places /cache/update/places
This API is based on the Web API Skeleton. This section covers steps related to the skeleton required to build and run the API.
HTTPS is required for Web APIs in development and production. Use keytool(1)
to generate public and private keys.
Generate key pair and keystore:
$ keytool \
-genkeypair \
-dname "CN=Jane Doe, OU=Enterprise Computing Services, O=Oregon State University, L=Corvallis, S=Oregon, C=US" \
-ext "san=dns:localhost,ip:127.0.0.1" \
-alias doej \
-keyalg RSA \
-keysize 2048 \
-sigalg SHA256withRSA \
-validity 365 \
-keystore doej.keystore
Export certificate to file:
$ keytool \
-exportcert \
-rfc \
-alias "doej" \
-keystore doej.keystore \
-file doej.pem
Import certificate into truststore:
$ keytool \
-importcert \
-alias "doej" \
-file doej.pem \
-keystore doej.truststore
This project uses the build automation tool Gradle. Use the Gradle Wrapper to download and install it automatically:
$ ./gradlew
The Gradle wrapper installs Gradle in the directory ~/.gradle
. To add it to your $PATH
, add the following line to ~/.bashrc
:
$ export PATH=$PATH:/home/user/.gradle/wrapper/dists/gradle-2.4-all/WRAPPER_GENERATED_HASH/gradle-2.4/bin
The changes will take effect once you restart the terminal or source ~/.bashrc
.
List all tasks runnable from root project:
$ gradle tasks
Generate IntelliJ IDEA project:
$ gradle idea
Open with File
-> Open Project
.
Copy configuration-example.yaml to configuration.yaml
. Modify as necessary, being careful to avoid committing sensitive data.
Build the project:
$ gradle build
JARs will be saved into the directory build/libs/
.
Run the project:
$ gradle run