This endpoint is for getting a specific location based on its ID.
HTTP Method
GET
Authentication Requirements
None
Request Data
location_idnumber
Required
Path
ID of the location to look up. This will go into the path of the request.
Response Data
Statusnumber
Status code for the request.
Messagestring
Status message for the request.
DataLocation Object | null
The requested location data or null on error.
idstring
The ID of the location.
namestring | null
The name of the location or null if none is set.
address-1string | null
The street address of the location or null if none is set.
address-2string | null
The additional address of the location or null if none is set.
citystring | null
The city of the location or null if none is set.
statestring | null
The state of the location or null if none is set. This will always be the 2 letter
abbreviation of the state.
zipstring | null
The zip of the location or null if none is set. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
user-idstring | null
The user UID that the location is saved to or null if none is set.
calendar-idstring | null
The calendar ID that the location is saved to or null if none is set.
Example Code
Javascript
async function eventsAPI() {
const response = await fetch('https://events.unl.edu/api/v2/location/27161/');
if (response.ok) {
const response_json = await response.json();
console.log(response_json.data);
}
}
CURL
curl -X GET 'https://events.unl.edu/api/v2/location/27161/'
PHP
function eventsAPI() {
$url = 'https://events.unl.edu/api/v2/location/27161/';
// Make an HTTP GET request using file_get_contents
$response = file_get_contents($url);
if ($response !== false) {
// Decode the JSON response
$responseData = json_decode($response, true);
// Check if JSON decoding was successful
if ($responseData !== null) {
// Access the 'data' field in the response JSON
var_dump($responseData);
} else {
echo 'JSON decoding error';
}
} else {
echo 'Error fetching data';
}
}
Read (Standard)
GET
http://events.unl.edu/api/v2/location/standard/
This endpoint is for getting a list of all the standard UNL campus locations and extension locations.
HTTP Method
GET
Authentication Requirements
None
Request Data
None
Response Data
Statusnumber
Status code for the request.
Messagestring
Status message for the request.
DataObject | null
The requested data or null on error.
MainArray of Location Objects
UNL campus locations.
idstring
The ID of the location.
namestring | null
The name of the location or null if none is set.
address-1string | null
The street address of the location or null if none is set.
address-2string | null
The additional address of the location or null if none is set.
citystring | null
The city of the location or null if none is set.
statestring | null
The state of the location or null if none is set. This will always be the 2 letter
abbreviation of the state.
zipstring | null
The zip of the location or null if none is set. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
user-idstring | null
The user UID that the location is saved to or null if none is set.
calendar-idstring | null
The calendar ID that the location is saved to or null if none is set.
ExtensionArray of Location Objects
Extension locations.
idstring
The ID of the location.
namestring | null
The name of the location or null if none is set.
address-1string | null
The street address of the location or null if none is set.
address-2string | null
The additional address of the location or null if none is set.
citystring | null
The city of the location or null if none is set.
statestring | null
The state of the location or null if none is set. This will always be the 2 letter
abbreviation of the state.
zipstring | null
The zip of the location or null if none is set. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
user-idstring | null
The user UID that the location is saved to or null if none is set.
calendar-idstring | null
The calendar ID that the location is saved to or null if none is set.
Example Code
Javascript
async function eventsAPI() {
const response = await fetch('https://events.unl.edu/api/v2/location/standard/');
if (response.ok) {
const response_json = await response.json();
console.log(response_json.data);
}
}
CURL
curl -X GET 'https://events.unl.edu/api/v2/location/standard/'
PHP
function eventsAPI() {
$url = 'https://events.unl.edu/api/v2/location/standard/';
// Make an HTTP GET request using file_get_contents
$response = file_get_contents($url);
if ($response !== false) {
// Decode the JSON response
$responseData = json_decode($response, true);
// Check if JSON decoding was successful
if ($responseData !== null) {
// Access the 'data' field in the response JSON
var_dump($responseData);
} else {
echo 'JSON decoding error';
}
} else {
echo 'Error fetching data';
}
}
Create
POST
http://events.unl.edu/api/v2/location/
This endpoint is for creating a new custom location.
HTTP Method
POST
Authentication Requirements
You must add a header to the request with the header key being Authentication and the value being your API Token.
Request Data
namestring
Required
The name of the location.
address-1string
Required
The street address of the location.
address-2string | null
The additional address of the location or null if none is set.
citystring
Required
The city of the location.
statestring
Required
The state of the location. This will always be the 2 letter
abbreviation of the state.
zipstring
Required
The zip of the location. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
save-userbool
If you want this saved to your user then set this to true, otherwise it will default to false.
If you do not save it to yourself or one of your calendars you will not be able to edit
it in the future.
save-calendarbool
If you want this saved to a calendar then set this to true, otherwise it will default to false.
If you do not save it to yourself or one of your calendars you will not be able to edit
it in the future.
calendar-idstring | null
The calendar ID that the location is saved to if the save-calendar is set.
Response Data
Statusnumber
Status code for the request.
Messagestring
Status message for the request.
DataLocation Object | null
The newly created location data or null on error.
idstring
The ID of the location.
namestring | null
The name of the location or null if none is set.
address-1string | null
The street address of the location or null if none is set.
address-2string | null
The additional address of the location or null if none is set.
citystring | null
The city of the location or null if none is set.
statestring | null
The state of the location or null if none is set. This will always be the 2 letter
abbreviation of the state.
zipstring | null
The zip of the location or null if none is set. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
user-idstring | null
The user UID that the location is saved to or null if none is set.
calendar-idstring | null
The calendar ID that the location is saved to or null if none is set.
Example Code
Javascript
async function eventsAPI() {
// Sets up data
const data = {
'name': 'Meeting room 1 at 1217',
'address-1': '1217 Q St',
'address-2': null,
'city': 'Lincoln',
'state': 'NE',
'zip': '68508',
'map-url': 'https://maps.unl.edu/L055',
'webpage': null,
'hours': null,
'phone': null,
'default-room': null,
'default-directions': 'Head upstairs and make a right: it should be right there.',
'default-additional-public-info': 'L055',
'save-user': true,
'save-calendar': true,
'calendar-id': '3809',
}
// Sends request with method, headers, and data
const response = await fetch(
'https://events.unl.edu/api/v2/location/',
{
method: 'POST',
headers: {
'content-type': 'application/json',
'Authentication': MY_API_TOKEN,
},
body: JSON.stringify(data),
}
);
// Checks response and throws error on error
if (response.ok) {
const response_json = await response.json();
console.log(response_json.data);
} else {
response.text().then(text => {throw new Error(text)})
}
}
CURL
curl -X POST https://events.unl.edu/api/v2/location/ \
-H "Content-Type: application/json" \
-H "Authentication: MY_API_TOKEN" \
-d '{
"name": "Meeting room 1 at 1217",
"address-1": "1217 Q St",
"address-2": null,
"city": "Lincoln",
"state": "NE",
"zip": "68508",
"map-url": "https://maps.unl.edu/L055",
"webpage": null,
"hours": null,
"phone": null,
"default-room": null,
"default-directions": "Head upstairs and make a right: it should be right there.",
"default-additional-public-info": "L055",
"save-user": true,
"save-calendar": true,
"calendar-id": "3809",
}'
PUT
http://events.unl.edu/api/v2/location/{location_id}/
This endpoint is for updating a specific location based on its ID.
HTTP Method
PUT
Authentication Requirements
You must add a header to the request with the header key being Authentication and the value being your API Token.
Request Data
Even if the data hasn't changed, please re-enter any previously existing data to avoid unintentional null values.
location_idstring
Required
Path
The id of the location to update. This will go into the path of the request.
namestring
Required
The name of the location.
address-1string
Required
The street address of the location.
address-2string | null
The additional address of the location or null if none is set.
citystring
Required
The city of the location.
statestring
Required
The state of the location. This will always be the 2 letter
abbreviation of the state.
zipstring
Required
The zip of the location. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
save-userbool
If you want this saved to your user then set this to true, otherwise it will default to false.
If this is set to false or omitted it will cause the location to be un-saved to you. If another
user has the location saved to them this will do nothing.
save-calendarbool
If you want this saved to a calendar then set this to true, otherwise it will default to false.
If this is set to false or omitted it will cause the location to be un-saved to your calendar. If
you do not have access to the calendar it is saved to this will do nothing.
calendar-idstring | null
The calendar ID that the location is saved to if the save-calendar is set.
Response Data
Statusnumber
Status code for the request.
Messagestring
Status message for the request.
DataLocation Object | null
The newly updated location data or null on error.
idstring
The ID of the location.
namestring | null
The name of the location or null if none is set.
address-1string | null
The street address of the location or null if none is set.
address-2string | null
The additional address of the location or null if none is set.
citystring | null
The city of the location or null if none is set.
statestring | null
The state of the location or null if none is set. This will always be the 2 letter
abbreviation of the state.
zipstring | null
The zip of the location or null if none is set. This will always be ≤ 10 characters
long.
map-urlstring | null
The url of the map graphical interface of the location or null if none is set.
This will always be a URL.
webpagestring | null
The web page of the location or null if none is set.
This will always be a URL.
hoursstring | null
The hours of the location or null if none is set.
phonestring | null
The phone number of the location or null if none is set.
default-roomstring | null
The room of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a room set.
default-directionsstring | null
The directions of the location or null if none is set. This will be overridden on
events.unl.edu if the event has a directions set.
default-additional-public-infostring | null
The additional public info of the location or null if none is set. This will be overridden on
events.unl.edu if the event has specific location additional public info set.
user-idstring | null
The user UID that the location is saved to or null if none is set.
calendar-idstring | null
The calendar ID that the location is saved to or null if none is set.
Example Code
Javascript
async function eventsAPI() {
// Sets up data
const data = {
'name': 'Meeting room 1 at 1217',
'address-1': '1217 Q St',
'address-2': null,
'city': 'Lincoln',
'state': 'NE',
'zip': '68508',
'map-url': 'https://maps.unl.edu/L055',
'webpage': null,
'hours': null,
'phone': null,
'default-room': null,
'default-directions': 'Head upstairs and make a right: it should be right there.',
'default-additional-public-info': 'L055',
'save-user': true,
'save-calendar': true,
'calendar-id': '3809',
}
// Sends request with method, headers, and data
const response = await fetch(
'https://events.unl.edu/api/v2/location/27217/',
{
method: 'PUT',
headers: {
'content-type': 'application/json',
'Authentication': MY_API_TOKEN,
},
body: JSON.stringify(data),
}
);
// Checks response and throws error on error
if (response.ok) {
const response_json = await response.json();
console.log(response_json.data);
} else {
response.text().then(text => {throw new Error(text)})
}
}
CURL
curl -X PUT https://events.unl.edu/api/v2/location/ \
-H "Content-Type: application/json" \
-H "Authentication: MY_API_TOKEN" \
-d '{
"name": "Meeting room 1 at 1217",
"address-1": "1217 Q St",
"address-2": null,
"city": "Lincoln",
"state": "NE",
"zip": "68508",
"map-url": "https://maps.unl.edu/L055",
"webpage": null,
"hours": null,
"phone": null,
"default-room": null,
"default-directions": "Head upstairs and make a right: it should be right there.",
"default-additional-public-info": "L055",
"save-user": true,
"save-calendar": true,
"calendar-id": "3809",
}'