Skill Level: 
Advanced

This API endpoint allows access for specific calendar events.

Available Endpoints

Read (By ID)

GET http://events.unl.edu/api/v2/calendar/{calendar_id}/event/{event_id}/

This endpoint is for getting a specific calendar event based on its ID.

HTTP Method


GET

Authentication Requirements


None

Request Data


  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • event_id number Required Path
    ID the event to be looked up. This will go into the path of the request.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data Event Object | null
    The requested event data or null on error.
    • id string
      The ID of the event.
    • title string | null
      The title of the event or null if none is set.
    • subtitle string | null
      The subtitle of the event or null if none is set.
    • description string | null
      The description of the event or null if none is set.
    • webpage string | null
      The webpage of the event or null if none is set. This will always be a URL.
    • private-public 'private' | 'public' | null
      The status of the event's publicity or null if none is set. This will always be public or private.
    • listing-contact-name string | null
      The event's listed contact's name or null if none is set.
    • listing-contact-phone string | null
      The event's listed contact's phone number or null if none is set.
    • listing-contact-email string | null
      The event's listed contact's email or null if none is set.
    • listing-contact-url string | null
      The event's listed contact's url or null if none is set. This will always be a URL.
    • listing-contact-type 'person' | 'organization' | null
      The type of the event's listed contact or null if none is set. This will always be a person or organization.
    • canceled bool
      If the event has been canceled.
    • calendar-event-status string
      The event status of that event on that calendar.
    • original-calendar Calendar Object
      The original calendar the event was posted on.
      • id string
        The ID of the calendar.
      • name string
        The name of the calendar.
      • short-name string
        The short name of the calendar. This can be used in the URL of other events API v2 requests.
      • default-timezone string
        The default timezone of the calendar. This can be overridden by event's data times.
      • webpage string | null
        The webpage of the calendar or null if none is set.
      • email-list string | null
        The list of emails for the calendar or null if none is set. Emails will be separated by commas.
      • event-release-preference string
        The release process for events after they are created on the calendar.
      • recommendations-within-account bool
        Whether users on the same account can recommend events to this calendar.
    • eventtypes Array of Event Type Objects
      A list of all the event types this event has attached to it. This list will only have one item in it.
      • ID String
        ID of the event type record.
      • Name String
        Name of the event type record.
    • audiences Array of Audience Objects
      A list of all the audiences this event has attached to it.
      • ID String
        ID of the audience record.
      • Name String
        Name of the audience record.
    • image-url string | null
      The URL of the image of the event or null if none are set. This will always be a URL.
    • occurrences Array of Event Occurrence Objects
      A list of all the occurrences of the event.
      • id string
        The ID of the occurrence date time. This ID can be used to look up events.
      • start-time string
        The start time of the occurrence date time. This is in the ISO 8601 format.
      • end-time string | null
        The end time of the occurrence date time or null if none is set. This is in the ISO 8601 format.
      • is-all-day bool
        Whether the event occurrence is all day or at a specific time.
      • time-mode string
        The time mode of the occurrence. These values can be 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'.
      • event-timezone string
        The timezone of the event occurrence. This will override the calendar's default timezone.
      • is-recurring bool
        Whether the event occurrence has recurrences or not.
      • recurs-until string | null
        The date the event occurrence will recur until.
      • recurs-type string
        The type of the occurrence's recurrence. These values can be "none", "daily", "weekly", "biweekly", "monthly", "annually".
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • canceled bool
        Whether the event occurrence has been canceled or not.
      • event-additional-public-info string | null
        The additional info for the event occurrence or null if none is set.
      • event-room string | null
        The room the event occurrence will take place or null if none is set. This will override the location's room.
      • event-directions string | null
        The directions for the event occurrence or null if none is set. This will override the location's directions.
      • event-location-additional-public-info string | null
        The additional info for the event occurrence's location or null if none is set. This will override the location's additional public info.
      • event-virtual-additional-public-info string | null
        The additional info for the event occurrence's virtual location or null if none is set. This will override the virtual location's additional public info.
      • link string | null
        The link to the events website for that event occurrence.
      • location Location Object | null
        The location of the event occurrence or null if none is set.
        • id string
          The ID of the location.
        • name string | null
          The name of the location or null if none is set.
        • address-1 string | null
          The street address of the location or null if none is set.
        • address-2 string | null
          The additional address of the location or null if none is set.
        • city string | null
          The city of the location or null if none is set.
        • state string | null
          The state of the location or null if none is set. This will always be the 2 letter abbreviation of the state.
        • zip string | null
          The zip of the location or null if none is set. This will always be ≤ 10 characters long.
        • map-url string | null
          The url of the map graphical interface of the location or null if none is set. This will always be a URL.
        • webpage string | null
          The web page of the location or null if none is set. This will always be a URL.
        • hours string | null
          The hours of the location or null if none is set.
        • phone string | null
          The phone number of the location or null if none is set.
        • default-room string | 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-directions string | 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-info string | 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-id string | null
          The user UID that the location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the location is saved to or null if none is set.
      • virtual-location Virtual Location Object | null
        The virtual location of the event occurrence or null if none is set.
        • id string
          The ID of the virtual location.
        • name string
          The name of the virtual location.
        • url string
          The url of the virtual location.
        • default-additional-public-info string | null
          The additional public info of the virtual location or null if none is set. This will be overridden on events.unl.edu if the event has specific virtual location additional public info set.
        • user-id string | null
          The user UID that the virtual location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the virtual location is saved to or null if none is set.
      • recurring-dates Array of Recurrence Objects
        A list of the event occurrence recurrences.
        • id string
          The ID of the recurrence record. This ID can be used to look up events.
        • recurring-date string
          The date of the recurrence. This is in YYYY-MM-DD format.
        • recurrence-id string
          The ID of the recurrence relative to the occurrence.
        • ongoing bool
          Whether the recurrence is ongoing.
        • canceled bool
          Whether this recurrence is canceled or not.
        • link string | null
          The link to the events website for that recurrence.

Example Code


Javascript
async function eventsAPI() {
    const response = await fetch('https://events.unl.edu/api/v2/calendar/3809/event/118830/');
    // const response = await fetch('https://events.unl.edu/api/v2/calendar/wdn_monthly/event/118830/');
    if (response.ok) {
        const response_json = await response.json();
        console.log(response_json.data);
    }
}
CURL
curl -X GET 'https://events.unl.edu/api/v2/calendar/3809/event/118830/'
PHP
function eventsAPI() {
    $url = 'https://events.unl.edu/api/v2/calendar/3809/event/118830/';
    // $url = 'https://events.unl.edu/api/v2/calendar/wdn_monthly/event/118830/';

    // 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 (Datetime ID)

GET http://events.unl.edu/api/v2/calendar/{calendar_id}/event/datetime/{datetime_id}/

This endpoint is for getting a specific calendar event based on its datetime ID.

HTTP Method


GET

Authentication Requirements


None

Request Data


  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • datetime_id number Required Path
    One of the event's occurrences datetime ID that the event will be looked up from. This will go into the path of the request.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data Event Object | null
    The requested event data or null on error.
    • id string
      The ID of the event.
    • title string | null
      The title of the event or null if none is set.
    • subtitle string | null
      The subtitle of the event or null if none is set.
    • description string | null
      The description of the event or null if none is set.
    • webpage string | null
      The webpage of the event or null if none is set. This will always be a URL.
    • private-public 'private' | 'public' | null
      The status of the event's publicity or null if none is set. This will always be public or private.
    • listing-contact-name string | null
      The event's listed contact's name or null if none is set.
    • listing-contact-phone string | null
      The event's listed contact's phone number or null if none is set.
    • listing-contact-email string | null
      The event's listed contact's email or null if none is set.
    • listing-contact-url string | null
      The event's listed contact's url or null if none is set. This will always be a URL.
    • listing-contact-type 'person' | 'organization' | null
      The type of the event's listed contact or null if none is set. This will always be a person or organization.
    • canceled bool
      If the event has been canceled.
    • calendar-event-status string
      The event status of that event on that calendar.
    • original-calendar Calendar Object
      The original calendar the event was posted on.
      • id string
        The ID of the calendar.
      • name string
        The name of the calendar.
      • short-name string
        The short name of the calendar. This can be used in the URL of other events API v2 requests.
      • default-timezone string
        The default timezone of the calendar. This can be overridden by event's data times.
      • webpage string | null
        The webpage of the calendar or null if none is set.
      • email-list string | null
        The list of emails for the calendar or null if none is set. Emails will be separated by commas.
      • event-release-preference string
        The release process for events after they are created on the calendar.
      • recommendations-within-account bool
        Whether users on the same account can recommend events to this calendar.
    • eventtypes Array of Event Type Objects
      A list of all the event types this event has attached to it. This list will only have one item in it.
      • ID String
        ID of the event type record.
      • Name String
        Name of the event type record.
    • audiences Array of Audience Objects
      A list of all the audiences this event has attached to it.
      • ID String
        ID of the audience record.
      • Name String
        Name of the audience record.
    • image-url string | null
      The URL of the image of the event or null if none are set. This will always be a URL.
    • occurrences Array of Event Occurrence Objects
      A list of all the occurrences of the event.
      • id string
        The ID of the occurrence date time. This ID can be used to look up events.
      • start-time string
        The start time of the occurrence date time. This is in the ISO 8601 format.
      • end-time string | null
        The end time of the occurrence date time or null if none is set. This is in the ISO 8601 format.
      • is-all-day bool
        Whether the event occurrence is all day or at a specific time.
      • time-mode string
        The time mode of the occurrence. These values can be 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'.
      • event-timezone string
        The timezone of the event occurrence. This will override the calendar's default timezone.
      • is-recurring bool
        Whether the event occurrence has recurrences or not.
      • recurs-until string | null
        The date the event occurrence will recur until.
      • recurs-type string
        The type of the occurrence's recurrence. These values can be "none", "daily", "weekly", "biweekly", "monthly", "annually".
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • canceled bool
        Whether the event occurrence has been canceled or not.
      • event-additional-public-info string | null
        The additional info for the event occurrence or null if none is set.
      • event-room string | null
        The room the event occurrence will take place or null if none is set. This will override the location's room.
      • event-directions string | null
        The directions for the event occurrence or null if none is set. This will override the location's directions.
      • event-location-additional-public-info string | null
        The additional info for the event occurrence's location or null if none is set. This will override the location's additional public info.
      • event-virtual-additional-public-info string | null
        The additional info for the event occurrence's virtual location or null if none is set. This will override the virtual location's additional public info.
      • link string | null
        The link to the events website for that event occurrence.
      • location Location Object | null
        The location of the event occurrence or null if none is set.
        • id string
          The ID of the location.
        • name string | null
          The name of the location or null if none is set.
        • address-1 string | null
          The street address of the location or null if none is set.
        • address-2 string | null
          The additional address of the location or null if none is set.
        • city string | null
          The city of the location or null if none is set.
        • state string | null
          The state of the location or null if none is set. This will always be the 2 letter abbreviation of the state.
        • zip string | null
          The zip of the location or null if none is set. This will always be ≤ 10 characters long.
        • map-url string | null
          The url of the map graphical interface of the location or null if none is set. This will always be a URL.
        • webpage string | null
          The web page of the location or null if none is set. This will always be a URL.
        • hours string | null
          The hours of the location or null if none is set.
        • phone string | null
          The phone number of the location or null if none is set.
        • default-room string | 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-directions string | 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-info string | 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-id string | null
          The user UID that the location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the location is saved to or null if none is set.
      • virtual-location Virtual Location Object | null
        The virtual location of the event occurrence or null if none is set.
        • id string
          The ID of the virtual location.
        • name string
          The name of the virtual location.
        • url string
          The url of the virtual location.
        • default-additional-public-info string | null
          The additional public info of the virtual location or null if none is set. This will be overridden on events.unl.edu if the event has specific virtual location additional public info set.
        • user-id string | null
          The user UID that the virtual location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the virtual location is saved to or null if none is set.
      • recurring-dates Array of Recurrence Objects
        A list of the event occurrence recurrences.
        • id string
          The ID of the recurrence record. This ID can be used to look up events.
        • recurring-date string
          The date of the recurrence. This is in YYYY-MM-DD format.
        • recurrence-id string
          The ID of the recurrence relative to the occurrence.
        • ongoing bool
          Whether the recurrence is ongoing.
        • canceled bool
          Whether this recurrence is canceled or not.
        • link string | null
          The link to the events website for that recurrence.

Example Code


Javascript
async function eventsAPI() {
    const response = await fetch('https://events.unl.edu/api/v2/calendar/3809/event/datetime/136744/');
    // const response = await fetch('https://events.unl.edu/api/v2/calendar/wdn_monthly/event/datetime/136744/');
    if (response.ok) {
        const response_json = await response.json();
        console.log(response_json.data);
    }
}
CURL
curl -X GET 'https://events.unl.edu/api/v2/calendar/3809/event/datetime/136744/'
PHP
function eventsAPI() {
    $url = 'https://events.unl.edu/api/v2/calendar/3809/event/datetime/136744/';
    // $url = 'https://events.unl.edu/api/v2/calendar/wdn_monthly/event/datetime/136744/';

    // 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 (Recurrence ID)

GET http://events.unl.edu/api/v2/calendar/{calendar_id}/event/datetime/recurrence/{recurrence_id}/

This endpoint is for getting a specific calendar event based on its recurring occurrence's ID.

HTTP Method


GET

Authentication Requirements


None

Request Data


  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • recurrence_id number Required Path
    An event's recurring datetime's recurrence ID that the event will be looked up from. This will go into the path of the request.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data Event Object | null
    The requested event data or null on error.
    • id string
      The ID of the event.
    • title string | null
      The title of the event or null if none is set.
    • subtitle string | null
      The subtitle of the event or null if none is set.
    • description string | null
      The description of the event or null if none is set.
    • webpage string | null
      The webpage of the event or null if none is set. This will always be a URL.
    • private-public 'private' | 'public' | null
      The status of the event's publicity or null if none is set. This will always be public or private.
    • listing-contact-name string | null
      The event's listed contact's name or null if none is set.
    • listing-contact-phone string | null
      The event's listed contact's phone number or null if none is set.
    • listing-contact-email string | null
      The event's listed contact's email or null if none is set.
    • listing-contact-url string | null
      The event's listed contact's url or null if none is set. This will always be a URL.
    • listing-contact-type 'person' | 'organization' | null
      The type of the event's listed contact or null if none is set. This will always be a person or organization.
    • canceled bool
      If the event has been canceled.
    • calendar-event-status string
      The event status of that event on that calendar.
    • original-calendar Calendar Object
      The original calendar the event was posted on.
      • id string
        The ID of the calendar.
      • name string
        The name of the calendar.
      • short-name string
        The short name of the calendar. This can be used in the URL of other events API v2 requests.
      • default-timezone string
        The default timezone of the calendar. This can be overridden by event's data times.
      • webpage string | null
        The webpage of the calendar or null if none is set.
      • email-list string | null
        The list of emails for the calendar or null if none is set. Emails will be separated by commas.
      • event-release-preference string
        The release process for events after they are created on the calendar.
      • recommendations-within-account bool
        Whether users on the same account can recommend events to this calendar.
    • eventtypes Array of Event Type Objects
      A list of all the event types this event has attached to it. This list will only have one item in it.
      • ID String
        ID of the event type record.
      • Name String
        Name of the event type record.
    • audiences Array of Audience Objects
      A list of all the audiences this event has attached to it.
      • ID String
        ID of the audience record.
      • Name String
        Name of the audience record.
    • image-url string | null
      The URL of the image of the event or null if none are set. This will always be a URL.
    • occurrences Array of Event Occurrence Objects
      A list of all the occurrences of the event.
      • id string
        The ID of the occurrence date time. This ID can be used to look up events.
      • start-time string
        The start time of the occurrence date time. This is in the ISO 8601 format.
      • end-time string | null
        The end time of the occurrence date time or null if none is set. This is in the ISO 8601 format.
      • is-all-day bool
        Whether the event occurrence is all day or at a specific time.
      • time-mode string
        The time mode of the occurrence. These values can be 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'.
      • event-timezone string
        The timezone of the event occurrence. This will override the calendar's default timezone.
      • is-recurring bool
        Whether the event occurrence has recurrences or not.
      • recurs-until string | null
        The date the event occurrence will recur until.
      • recurs-type string
        The type of the occurrence's recurrence. These values can be "none", "daily", "weekly", "biweekly", "monthly", "annually".
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • canceled bool
        Whether the event occurrence has been canceled or not.
      • event-additional-public-info string | null
        The additional info for the event occurrence or null if none is set.
      • event-room string | null
        The room the event occurrence will take place or null if none is set. This will override the location's room.
      • event-directions string | null
        The directions for the event occurrence or null if none is set. This will override the location's directions.
      • event-location-additional-public-info string | null
        The additional info for the event occurrence's location or null if none is set. This will override the location's additional public info.
      • event-virtual-additional-public-info string | null
        The additional info for the event occurrence's virtual location or null if none is set. This will override the virtual location's additional public info.
      • link string | null
        The link to the events website for that event occurrence.
      • location Location Object | null
        The location of the event occurrence or null if none is set.
        • id string
          The ID of the location.
        • name string | null
          The name of the location or null if none is set.
        • address-1 string | null
          The street address of the location or null if none is set.
        • address-2 string | null
          The additional address of the location or null if none is set.
        • city string | null
          The city of the location or null if none is set.
        • state string | null
          The state of the location or null if none is set. This will always be the 2 letter abbreviation of the state.
        • zip string | null
          The zip of the location or null if none is set. This will always be ≤ 10 characters long.
        • map-url string | null
          The url of the map graphical interface of the location or null if none is set. This will always be a URL.
        • webpage string | null
          The web page of the location or null if none is set. This will always be a URL.
        • hours string | null
          The hours of the location or null if none is set.
        • phone string | null
          The phone number of the location or null if none is set.
        • default-room string | 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-directions string | 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-info string | 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-id string | null
          The user UID that the location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the location is saved to or null if none is set.
      • virtual-location Virtual Location Object | null
        The virtual location of the event occurrence or null if none is set.
        • id string
          The ID of the virtual location.
        • name string
          The name of the virtual location.
        • url string
          The url of the virtual location.
        • default-additional-public-info string | null
          The additional public info of the virtual location or null if none is set. This will be overridden on events.unl.edu if the event has specific virtual location additional public info set.
        • user-id string | null
          The user UID that the virtual location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the virtual location is saved to or null if none is set.
      • recurring-dates Array of Recurrence Objects
        A list of the event occurrence recurrences.
        • id string
          The ID of the recurrence record. This ID can be used to look up events.
        • recurring-date string
          The date of the recurrence. This is in YYYY-MM-DD format.
        • recurrence-id string
          The ID of the recurrence relative to the occurrence.
        • ongoing bool
          Whether the recurrence is ongoing.
        • canceled bool
          Whether this recurrence is canceled or not.
        • link string | null
          The link to the events website for that recurrence.

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/calendar/{calendar_id}/event/

This endpoint is for creating a new calendar event.

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


  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • title string Required
    The title of the event.
  • subtitle string | null
    The subtitle of the event.
  • description string | null
    The description of the event.
  • webpage string | null
    The webpage of the event. This will have to be a valid URL.
  • eventtype string Required
    The ID of the event type to be linked to this event.
  • audience-{audience_id} bool
    Since there can be multiple audiences per event this parameter you will need to add the ID of the audience and then set the value to true or false whether the event would target that audience or not. e.g. 'audience-5': true, Audiences omitted will be defaulted to false.
  • canceled bool
    Whether the event has been canceled.
  • event-timezone string Required
    The timezone for the event occurrence. The options for this are Eastern, Central, Mountain, Arizona, and Pacific.
  • start-date string Required
    The date the event will occur. This will be in mm/dd/yyy format.
  • start-time-hour string | null
    The hour portion of the event start time. This number will be in the range of 1-12. This will default to 12.
  • start-time-minute string | null
    The minute portion of the event start time. This number will be in the range of 0-59. This will default to 0.
  • start-time-am-pm string | null
    The minute portion of the event start time. This number will be 'am' or 'pm'. This will default to 'am'.
  • end-time-hour string | null
    The hour portion of the event end time. This number will be in the range of 1-12. This will default to 12.
  • end-time-minute string | null
    The minute portion of the event end time. This number will be in the range of 0-59. This will default to 0.
  • end-time-am-pm string | null
    The minute portion of the event end time. This number will be 'am' or 'pm'. This will default to 'am'.
  • time-mode string Required
    The format the start/end times are in. Available values are 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'. Time mode STARTTIMEONLY will overwrite the end time values with the start time values. Time mode ENDTIMEONLY will overwrite the start time values with the end time values. Time mode ALLDAY will overwrite the start time and end time values with all day values. Time mode TBD will overwrite the start time and end time values with all day values.
  • recurring-type string | null
    If this event will be recurring the type of recurrence. The options are daily, weekly, annually, date (same day of each month), last (last of that day of the week of the month), first (first of that day of the week of the month), second (second of that day of the week of the month), third (third of that day of the week of the month), fourth (fourth of that day of the week of the month), and lastday (last day of the month).
  • recurs-until-date string | null
    The date that the event will recur until. If the recurring type is set then this will need to be set.
  • event-additional-public-info string | null
    Any additional info for the event occurrence.
  • location string | null
    The ID of the location of the event.
  • event-room string | null
    The room for this specific event occurrence.
  • event-directions string | null
    The directions for this specific event occurrence.
  • event-location-additional-public-info string | null
    Any additional info for this location for this specific event occurrence.
  • virtual-location string | null
    The ID of the virtual location of the event.
  • event-virtual-location-additional-public-info string | null
    Any additional info for this virtual location for this specific event occurrence.
  • private-public string | null
    Whether the event should be private or public. The options for this should be private or public.
  • listing-contact-type string | null
    The type of the listing contact. The options for this should be person or organization.
  • listing-contact-name string | null
    The name of the listing contact.
  • listing-contact-phone string | null
    The phone of the listing contact.
  • listing-contact-email string | null
    The email of the listing contact.
  • listing-contact-website string | null
    The website of the listing contact. This should be a valid URL.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data Event Object | null
    The newly created event data or null on error.
    • id string
      The ID of the event.
    • title string | null
      The title of the event or null if none is set.
    • subtitle string | null
      The subtitle of the event or null if none is set.
    • description string | null
      The description of the event or null if none is set.
    • webpage string | null
      The webpage of the event or null if none is set. This will always be a URL.
    • private-public 'private' | 'public' | null
      The status of the event's publicity or null if none is set. This will always be public or private.
    • listing-contact-name string | null
      The event's listed contact's name or null if none is set.
    • listing-contact-phone string | null
      The event's listed contact's phone number or null if none is set.
    • listing-contact-email string | null
      The event's listed contact's email or null if none is set.
    • listing-contact-url string | null
      The event's listed contact's url or null if none is set. This will always be a URL.
    • listing-contact-type 'person' | 'organization' | null
      The type of the event's listed contact or null if none is set. This will always be a person or organization.
    • canceled bool
      If the event has been canceled.
    • calendar-event-status string
      The event status of that event on that calendar.
    • original-calendar Calendar Object
      The original calendar the event was posted on.
      • id string
        The ID of the calendar.
      • name string
        The name of the calendar.
      • short-name string
        The short name of the calendar. This can be used in the URL of other events API v2 requests.
      • default-timezone string
        The default timezone of the calendar. This can be overridden by event's data times.
      • webpage string | null
        The webpage of the calendar or null if none is set.
      • email-list string | null
        The list of emails for the calendar or null if none is set. Emails will be separated by commas.
      • event-release-preference string
        The release process for events after they are created on the calendar.
      • recommendations-within-account bool
        Whether users on the same account can recommend events to this calendar.
    • eventtypes Array of Event Type Objects
      A list of all the event types this event has attached to it. This list will only have one item in it.
      • ID String
        ID of the event type record.
      • Name String
        Name of the event type record.
    • audiences Array of Audience Objects
      A list of all the audiences this event has attached to it.
      • ID String
        ID of the audience record.
      • Name String
        Name of the audience record.
    • image-url string | null
      The URL of the image of the event or null if none are set. This will always be a URL.
    • occurrences Array of Event Occurrence Objects
      A list of all the occurrences of the event.
      • id string
        The ID of the occurrence date time. This ID can be used to look up events.
      • start-time string
        The start time of the occurrence date time. This is in the ISO 8601 format.
      • end-time string | null
        The end time of the occurrence date time or null if none is set. This is in the ISO 8601 format.
      • time-mode string
        The time mode of the occurrence. These values can be 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'.
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • event-timezone string
        The timezone of the event occurrence. This will override the calendar's default timezone.
      • is-recurring bool
        Whether the event occurrence has recurrences or not.
      • recurs-until string | null
        The date the event occurrence will recur until.
      • recurs-type string
        The type of the occurrence's recurrence. These values can be "none", "daily", "weekly", "biweekly", "monthly", "annually".
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • canceled bool
        Whether the event occurrence has been canceled or not.
      • event-additional-public-info string | null
        The additional info for the event occurrence or null if none is set.
      • event-room string | null
        The room the event occurrence will take place or null if none is set. This will override the location's room.
      • event-directions string | null
        The directions for the event occurrence or null if none is set. This will override the location's directions.
      • event-location-additional-public-info string | null
        The additional info for the event occurrence's location or null if none is set. This will override the location's additional public info.
      • event-virtual-additional-public-info string | null
        The additional info for the event occurrence's virtual location or null if none is set. This will override the virtual location's additional public info.
      • link string | null
        The link to the events website for that event occurrence.
      • location Location Object | null
        The location of the event occurrence or null if none is set.
        • id string
          The ID of the location.
        • name string | null
          The name of the location or null if none is set.
        • address-1 string | null
          The street address of the location or null if none is set.
        • address-2 string | null
          The additional address of the location or null if none is set.
        • city string | null
          The city of the location or null if none is set.
        • state string | null
          The state of the location or null if none is set. This will always be the 2 letter abbreviation of the state.
        • zip string | null
          The zip of the location or null if none is set. This will always be ≤ 10 characters long.
        • map-url string | null
          The url of the map graphical interface of the location or null if none is set. This will always be a URL.
        • webpage string | null
          The web page of the location or null if none is set. This will always be a URL.
        • hours string | null
          The hours of the location or null if none is set.
        • phone string | null
          The phone number of the location or null if none is set.
        • default-room string | 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-directions string | 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-info string | 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-id string | null
          The user UID that the location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the location is saved to or null if none is set.
      • virtual-location Virtual Location Object | null
        The virtual location of the event occurrence or null if none is set.
        • id string
          The ID of the virtual location.
        • name string
          The name of the virtual location.
        • url string
          The url of the virtual location.
        • default-additional-public-info string | null
          The additional public info of the virtual location or null if none is set. This will be overridden on events.unl.edu if the event has specific virtual location additional public info set.
        • user-id string | null
          The user UID that the virtual location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the virtual location is saved to or null if none is set.
      • recurring-dates Array of Recurrence Objects
        A list of the event occurrence recurrences.
        • id string
          The ID of the recurrence record. This ID can be used to look up events.
        • recurring-date string
          The date of the recurrence. This is in YYYY-MM-DD format.
        • recurrence-id string
          The ID of the recurrence relative to the occurrence.
        • ongoing bool
          Whether the recurrence is ongoing.
        • canceled bool
          Whether this recurrence is canceled or not.
        • link string | null
          The link to the events website for that recurrence.

Example Code


Javascript
async function eventsAPI() {

    // Sets up data
    const data = {
        'title': 'API Event Documentation',
        'subtitle': 'Subtitle for the event',
        'description': 'Testing out the API for making an event',
        'webpage': 'https://www.unl.edu/',
        'eventtype': '65',
        'audience-1': true,
        'audience-2': true,
        'canceled': false,
        'event-timezone': 'central',
        'start-date': '07/28/2023',
        'start-time-hour': '05',
        'start-time-minute': '30',
        'start-time-am-pm': 'pm',
        'time-mode': 'REGULAR',
        'end-time-hour': '06',
        'end-time-minute': '35',
        'end-time-am-pm': 'pm',
        'recurring-type': 'date',
        'recurs-until-date': '07/28/2024',
        'event-additional-public-info': 'This is an API generated event',
        'location': '27161',
        'event-room': 'Meeting room 1',
        'event-directions': 'Go up the stairs and take a left.',
        'event-location-additional-public-info': 'It will be above the goodly cookies.',
        'virtual-location': '1234',
        'event-virtual-location-additional-public-info': 'password is cookies.',
        'private-public': 'public',
        'listing-contact-type': 'person',
        'listing-contact-name': 'herbie',
        'listing-contact-phone': '402-867-5309',
        'listing-contact-email': 'hhusker2@unl.edu',
        'listing-contact-website': 'https://www.unl.edu/',
    }

    // Sends request with method, headers, and data
    const response = await fetch(
        'https://events.unl.edu/api/v2/calendar/3809/event/',
        {
            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/calendar/3809/event/ \
-H "Content-Type: application/json" \
-H "Authentication: MY_API_TOKEN" \
-d '{
    "title": "API Event Documentation",
    "subtitle": "Subtitle for the event",
    "description": "Testing out the API for making an event",
    "webpage": "https://www.unl.edu/",
    "eventtype": "65",
    "audience-1": true,
    "audience-2": true,
    "canceled": false,
    "event-timezone": "central",
    "start-date": "07/28/2023",
    "start-time-hour": "05",
    "start-time-minute": "30",
    "start-time-am-pm": "pm",
    "time-mode": "REGULAR",
    "end-time-hour": "06",
    "end-time-minute": "35",
    "end-time-am-pm": "pm",
    "recurring-type": "date",
    "recurs-until-date": "07/28/2024",
    "event-additional-public-info": "This is an API generated event",
    "location": "27161",
    "event-room": "Meeting room 1",
    "event-directions": "Go up the stairs and take a left.",
    "event-location-additional-public-info": "It will be above the goodly cookies.",
    "virtual-location": "1234",
    "event-virtual-location-additional-public-info": "password is cookies.",
    "private-public": "public",
    "listing-contact-type": "person",
    "listing-contact-name": "herbie",
    "listing-contact-phone": "402-867-5309",
    "listing-contact-email": "hhusker2@unl.edu",
    "listing-contact-website": "https://www.unl.edu/",
}'
PHP
function eventsAPI() {
    $data = array(
        'title' => 'API Event Documentation',
        'subtitle' => 'Subtitle for the event',
        'description' => 'Testing out the API for making an event',
        'webpage' => 'https://www.unl.edu/',
        'eventtype' => '65',
        'audience-1' => true,
        'audience-2' => true,
        'canceled' => false,
        'event-timezone' => 'central',
        'start-date' => '07/28/2023',
        'start-time-hour' => '05',
        'start-time-minute' => '30',
        'start-time-am-pm' => 'pm',
        'time-mode' => 'REGULAR',
        'end-time-hour' => '06',
        'end-time-minute' => '35',
        'end-time-am-pm' => 'pm',
        'recurring-type' => 'date',
        'recurs-until-date' => '07/28/2024',
        'event-additional-public-info' => 'This is an API generated event',
        'location' => '27161',
        'event-room' => 'Meeting room 1',
        'event-directions' => 'Go up the stairs and take a left.',
        'event-location-additional-public-info' => 'It will be above the goodly cookies.',
        'virtual-location' => '1234',
        'event-virtual-location-additional-public-info' => 'password is cookies.',
        'private-public' => 'public',
        'listing-contact-type' => 'person',
        'listing-contact-name' => 'herbie',
        'listing-contact-phone' => '402-867-5309',
        'listing-contact-email' => 'hhusker2@unl.edu',
        'listing-contact-website' => 'https://www.unl.edu/',
    );

    $jsonData = json_encode($data);

    $apiToken = 'MY_API_TOKEN';

    $url = 'https://events.unl.edu/api/v2/calendar/3809/event/';
    $headers = array(
        'Content-Type: application/json',
        'Authentication: ' . $apiToken,
    );

    // Initialize cURL session
    $ch = curl_init();

    // Set cURL options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    // Execute cURL session and get the response
    $response = curl_exec($ch);

    // Check if cURL request was successful
    if ($response === false) {
        // Handle cURL error
        echo 'cURL Error: ' . curl_error($ch);
    } else {
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if ($httpCode === 200) {
            // Successful response
            $responseData = json_decode($response, true);
            var_dump($responseData);
        } else {
            // Error response
            echo 'API Error: ' . $response;
        }
    }

    // Close cURL session
    curl_close($ch);
}

Update

PUT http://events.unl.edu/api/v2/calendar/{calendar_id}/event/{event_id}/

This endpoint is for updating a specific calendar event 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.

Due to the nature of the event occurrences editing an event will not allow you to update the event occurrences.

  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • event_id number Required Path
    ID the event to be looked up. This will go into the path of the request.
  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • title string Required
    The title of the event.
  • subtitle string | null
    The subtitle of the event.
  • description string | null
    The description of the event.
  • webpage string | null
    The webpage of the event. This will have to be a valid URL.
  • eventtype string Required
    The ID of the event type to be linked to this event.
  • audience-{audience_id} bool
    Since there can be multiple audiences per event this parameter you will need to add the ID of the audience and then set the value to true or false whether the event would target that audience or not. e.g. 'audience-5': true, Audiences omitted will be defaulted to false.
  • canceled bool
    Whether the event has been canceled.
  • private-public string | null
    Whether the event should be private or public. The options for this should be private or public.
  • listing-contact-type string | null
    The type of the listing contact. The options for this should be person or organization.
  • listing-contact-name string | null
    The name of the listing contact.
  • listing-contact-phone string | null
    The phone of the listing contact.
  • listing-contact-email string | null
    The email of the listing contact.
  • listing-contact-website string | null
    The website of the listing contact. This should be a valid URL.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data Event Object | null
    The newly updated event data or null on error.
    • id string
      The ID of the event.
    • title string | null
      The title of the event or null if none is set.
    • subtitle string | null
      The subtitle of the event or null if none is set.
    • description string | null
      The description of the event or null if none is set.
    • webpage string | null
      The webpage of the event or null if none is set. This will always be a URL.
    • private-public 'private' | 'public' | null
      The status of the event's publicity or null if none is set. This will always be public or private.
    • listing-contact-name string | null
      The event's listed contact's name or null if none is set.
    • listing-contact-phone string | null
      The event's listed contact's phone number or null if none is set.
    • listing-contact-email string | null
      The event's listed contact's email or null if none is set.
    • listing-contact-url string | null
      The event's listed contact's url or null if none is set. This will always be a URL.
    • listing-contact-type 'person' | 'organization' | null
      The type of the event's listed contact or null if none is set. This will always be a person or organization.
    • canceled bool
      If the event has been canceled.
    • calendar-event-status string
      The event status of that event on that calendar.
    • original-calendar Calendar Object
      The original calendar the event was posted on.
      • id string
        The ID of the calendar.
      • name string
        The name of the calendar.
      • short-name string
        The short name of the calendar. This can be used in the URL of other events API v2 requests.
      • default-timezone string
        The default timezone of the calendar. This can be overridden by event's data times.
      • webpage string | null
        The webpage of the calendar or null if none is set.
      • email-list string | null
        The list of emails for the calendar or null if none is set. Emails will be separated by commas.
      • event-release-preference string
        The release process for events after they are created on the calendar.
      • recommendations-within-account bool
        Whether users on the same account can recommend events to this calendar.
    • eventtypes Array of Event Type Objects
      A list of all the event types this event has attached to it. This list will only have one item in it.
      • ID String
        ID of the event type record.
      • Name String
        Name of the event type record.
    • audiences Array of Audience Objects
      A list of all the audiences this event has attached to it.
      • ID String
        ID of the audience record.
      • Name String
        Name of the audience record.
    • image-url string | null
      The URL of the image of the event or null if none are set. This will always be a URL.
    • occurrences Array of Event Occurrence Objects
      A list of all the occurrences of the event.
      • id string
        The ID of the occurrence date time. This ID can be used to look up events.
      • start-time string
        The start time of the occurrence date time. This is in the ISO 8601 format.
      • end-time string | null
        The end time of the occurrence date time or null if none is set. This is in the ISO 8601 format.
      • is-all-day bool
        Whether the event occurrence is all day or at a specific time.
      • time-mode string
        The time mode of the occurrence. These values can be 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'.
      • event-timezone string
        The timezone of the event occurrence. This will override the calendar's default timezone.
      • is-recurring bool
        Whether the event occurrence has recurrences or not.
      • recurs-until string | null
        The date the event occurrence will recur until.
      • recurs-type string
        The type of the occurrence's recurrence. These values can be "none", "daily", "weekly", "biweekly", "monthly", "annually".
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • canceled bool
        Whether the event occurrence has been canceled or not.
      • event-additional-public-info string | null
        The additional info for the event occurrence or null if none is set.
      • event-room string | null
        The room the event occurrence will take place or null if none is set. This will override the location's room.
      • event-directions string | null
        The directions for the event occurrence or null if none is set. This will override the location's directions.
      • event-location-additional-public-info string | null
        The additional info for the event occurrence's location or null if none is set. This will override the location's additional public info.
      • event-virtual-additional-public-info string | null
        The additional info for the event occurrence's virtual location or null if none is set. This will override the virtual location's additional public info.
      • link string | null
        The link to the events website for that event occurrence.
      • location Location Object | null
        The location of the event occurrence or null if none is set.
        • id string
          The ID of the location.
        • name string | null
          The name of the location or null if none is set.
        • address-1 string | null
          The street address of the location or null if none is set.
        • address-2 string | null
          The additional address of the location or null if none is set.
        • city string | null
          The city of the location or null if none is set.
        • state string | null
          The state of the location or null if none is set. This will always be the 2 letter abbreviation of the state.
        • zip string | null
          The zip of the location or null if none is set. This will always be ≤ 10 characters long.
        • map-url string | null
          The url of the map graphical interface of the location or null if none is set. This will always be a URL.
        • webpage string | null
          The web page of the location or null if none is set. This will always be a URL.
        • hours string | null
          The hours of the location or null if none is set.
        • phone string | null
          The phone number of the location or null if none is set.
        • default-room string | 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-directions string | 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-info string | 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-id string | null
          The user UID that the location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the location is saved to or null if none is set.
      • virtual-location Virtual Location Object | null
        The virtual location of the event occurrence or null if none is set.
        • id string
          The ID of the virtual location.
        • name string
          The name of the virtual location.
        • url string
          The url of the virtual location.
        • default-additional-public-info string | null
          The additional public info of the virtual location or null if none is set. This will be overridden on events.unl.edu if the event has specific virtual location additional public info set.
        • user-id string | null
          The user UID that the virtual location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the virtual location is saved to or null if none is set.
      • recurring-dates Array of Recurrence Objects
        A list of the event occurrence recurrences.
        • id string
          The ID of the recurrence record. This ID can be used to look up events.
        • recurring-date string
          The date of the recurrence. This is in YYYY-MM-DD format.
        • recurrence-id string
          The ID of the recurrence relative to the occurrence.
        • ongoing bool
          Whether the recurrence is ongoing.
        • canceled bool
          Whether this recurrence is canceled or not.
        • link string | null
          The link to the events website for that recurrence.

Example Code


Javascript
async function eventsAPI() {

    // Sets up data
    const data = {
        'title': 'API Event Documentation',
        'subtitle': 'Subtitle for the event',
        'description': 'Testing out the API for making an event',
        'webpage': 'https://www.unl.edu/',
        'eventtype': '65',
        'audience-1': true,
        'audience-2': true,
        'canceled': false,
        'private-public': 'public',
        'listing-contact-type': 'person',
        'listing-contact-name': 'herbie',
        'listing-contact-phone': '402-867-5309',
        'listing-contact-email': 'hhusker2@unl.edu',
        'listing-contact-website': 'https://www.unl.edu/',
    }

    // Sends request with method, headers, and data
    const response = await fetch(
        'https://events.unl.edu/api/v2/calendar/3809/event/12345/',
        {
            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/calendar/3809/event/12345/ \
-H "Content-Type: application/json" \
-H "Authentication: MY_API_TOKEN" \
-d '{
    "title": "API Event Documentation",
    "subtitle": "Subtitle for the event",
    "description": "Testing out the API for making an event",
    "webpage": "https://www.unl.edu/",
    "eventtype": "65",
    "audience-1": true,
    "audience-2": true,
    "canceled": false,
    "private-public": "public",
    "listing-contact-type": "person",
    "listing-contact-name": "herbie",
    "listing-contact-phone": "402-867-5309",
    "listing-contact-email": "hhusker2@unl.edu",
    "listing-contact-website": "https://www.unl.edu/",
}'
PHP
function eventsAPI() {
    $data = array(
        'title' => 'API Event Documentation',
        'subtitle' => 'Subtitle for the event',
        'description' => 'Testing out the API for making an event',
        'webpage' => 'https://www.unl.edu/',
        'eventtype' => '65',
        'audience-1' => true,
        'audience-2' => true,
        'canceled' => false,
        'private-public' => 'public',
        'listing-contact-type' => 'person',
        'listing-contact-name' => 'herbie',
        'listing-contact-phone' => '402-867-5309',
        'listing-contact-email' => 'hhusker2@unl.edu',
        'listing-contact-website' => 'https://www.unl.edu/',
    );

    $jsonData = json_encode($data);

    $apiToken = 'MY_API_TOKEN';

    $url = 'https://events.unl.edu/api/v2/calendar/3809/event/';
    $headers = array(
        'Content-Type: application/json',
        'Authentication: ' . $apiToken,
    );

    // Initialize cURL session
    $ch = curl_init();

    // Set cURL options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    // Execute cURL session and get the response
    $response = curl_exec($ch);

    // Check if cURL request was successful
    if ($response === false) {
        // Handle cURL error
        echo 'cURL Error: ' . curl_error($ch);
    } else {
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if ($httpCode === 200) {
            // Successful response
            $responseData = json_decode($response, true);
            var_dump($responseData);
        } else {
            // Error response
            echo 'API Error: ' . $response;
        }
    }

    // Close cURL session
    curl_close($ch);
}

Update (Status)

PUT http://events.unl.edu/api/v2/calendar/{calendar_id}/event/{event_id}/status/

This endpoint is for updating a specific calendar event's status.

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.

Due to the nature of the event occurrences editing an event will not allow you to update the event occurrences.

  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • event_id number Required Path
    ID the event to be looked up. This will go into the path of the request.
  • status string Required
    The status of the event on that calendar. Available status are pending, posted, archived.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data Event Object | null
    The newly updated event data or null on error.
    • id string
      The ID of the event.
    • title string | null
      The title of the event or null if none is set.
    • subtitle string | null
      The subtitle of the event or null if none is set.
    • description string | null
      The description of the event or null if none is set.
    • webpage string | null
      The webpage of the event or null if none is set. This will always be a URL.
    • private-public 'private' | 'public' | null
      The status of the event's publicity or null if none is set. This will always be public or private.
    • listing-contact-name string | null
      The event's listed contact's name or null if none is set.
    • listing-contact-phone string | null
      The event's listed contact's phone number or null if none is set.
    • listing-contact-email string | null
      The event's listed contact's email or null if none is set.
    • listing-contact-url string | null
      The event's listed contact's url or null if none is set. This will always be a URL.
    • listing-contact-type 'person' | 'organization' | null
      The type of the event's listed contact or null if none is set. This will always be a person or organization.
    • canceled bool
      If the event has been canceled.
    • calendar-event-status string
      The event status of that event on that calendar.
    • original-calendar Calendar Object
      The original calendar the event was posted on.
      • id string
        The ID of the calendar.
      • name string
        The name of the calendar.
      • short-name string
        The short name of the calendar. This can be used in the URL of other events API v2 requests.
      • default-timezone string
        The default timezone of the calendar. This can be overridden by event's data times.
      • webpage string | null
        The webpage of the calendar or null if none is set.
      • email-list string | null
        The list of emails for the calendar or null if none is set. Emails will be separated by commas.
      • event-release-preference string
        The release process for events after they are created on the calendar.
      • recommendations-within-account bool
        Whether users on the same account can recommend events to this calendar.
    • eventtypes Array of Event Type Objects
      A list of all the event types this event has attached to it. This list will only have one item in it.
      • ID String
        ID of the event type record.
      • Name String
        Name of the event type record.
    • audiences Array of Audience Objects
      A list of all the audiences this event has attached to it.
      • ID String
        ID of the audience record.
      • Name String
        Name of the audience record.
    • image-url string | null
      The URL of the image of the event or null if none are set. This will always be a URL.
    • occurrences Array of Event Occurrence Objects
      A list of all the occurrences of the event.
      • id string
        The ID of the occurrence date time. This ID can be used to look up events.
      • start-time string
        The start time of the occurrence date time. This is in the ISO 8601 format.
      • end-time string | null
        The end time of the occurrence date time or null if none is set. This is in the ISO 8601 format.
      • is-all-day bool
        Whether the event occurrence is all day or at a specific time.
      • time-mode string
        The time mode of the occurrence. These values can be 'REGULAR', 'STARTTIMEONLY', 'ENDTIMEONLY', 'ALLDAY', 'TBD'.
      • event-timezone string
        The timezone of the event occurrence. This will override the calendar's default timezone.
      • is-recurring bool
        Whether the event occurrence has recurrences or not.
      • recurs-until string | null
        The date the event occurrence will recur until.
      • recurs-type string
        The type of the occurrence's recurrence. These values can be "none", "daily", "weekly", "biweekly", "monthly", "annually".
      • recurs-monthly-type string | null
        The type of recurring monthly the event occurrence will be. These values can be "first", "second", "third", "fourth", "last", "lastday", "date".
      • canceled bool
        Whether the event occurrence has been canceled or not.
      • event-additional-public-info string | null
        The additional info for the event occurrence or null if none is set.
      • event-room string | null
        The room the event occurrence will take place or null if none is set. This will override the location's room.
      • event-directions string | null
        The directions for the event occurrence or null if none is set. This will override the location's directions.
      • event-location-additional-public-info string | null
        The additional info for the event occurrence's location or null if none is set. This will override the location's additional public info.
      • event-virtual-additional-public-info string | null
        The additional info for the event occurrence's virtual location or null if none is set. This will override the virtual location's additional public info.
      • link string | null
        The link to the events website for that event occurrence.
      • location Location Object | null
        The location of the event occurrence or null if none is set.
        • id string
          The ID of the location.
        • name string | null
          The name of the location or null if none is set.
        • address-1 string | null
          The street address of the location or null if none is set.
        • address-2 string | null
          The additional address of the location or null if none is set.
        • city string | null
          The city of the location or null if none is set.
        • state string | null
          The state of the location or null if none is set. This will always be the 2 letter abbreviation of the state.
        • zip string | null
          The zip of the location or null if none is set. This will always be ≤ 10 characters long.
        • map-url string | null
          The url of the map graphical interface of the location or null if none is set. This will always be a URL.
        • webpage string | null
          The web page of the location or null if none is set. This will always be a URL.
        • hours string | null
          The hours of the location or null if none is set.
        • phone string | null
          The phone number of the location or null if none is set.
        • default-room string | 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-directions string | 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-info string | 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-id string | null
          The user UID that the location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the location is saved to or null if none is set.
      • virtual-location Virtual Location Object | null
        The virtual location of the event occurrence or null if none is set.
        • id string
          The ID of the virtual location.
        • name string
          The name of the virtual location.
        • url string
          The url of the virtual location.
        • default-additional-public-info string | null
          The additional public info of the virtual location or null if none is set. This will be overridden on events.unl.edu if the event has specific virtual location additional public info set.
        • user-id string | null
          The user UID that the virtual location is saved to or null if none is set.
        • calendar-id string | null
          The calendar ID that the virtual location is saved to or null if none is set.
      • recurring-dates Array of Recurrence Objects
        A list of the event occurrence recurrences.
        • id string
          The ID of the recurrence record. This ID can be used to look up events.
        • recurring-date string
          The date of the recurrence. This is in YYYY-MM-DD format.
        • recurrence-id string
          The ID of the recurrence relative to the occurrence.
        • ongoing bool
          Whether the recurrence is ongoing.
        • canceled bool
          Whether this recurrence is canceled or not.
        • link string | null
          The link to the events website for that recurrence.

Example Code


Javascript
async function eventsAPI() {

    // Sets up data
    const data = {
        'status': 'pending'
    }

    // Sends request with method, headers, and data
    const response = await fetch(
        'https://events.unl.edu/api/v2/calendar/3809/event/12345/status/',
        {
            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/calendar/3809/event/12345/status/ \
-H "Content-Type: application/json" \
-H "Authentication: MY_API_TOKEN" \
-d '{
    "status": "pending",
}'
PHP
function eventsAPI() {
    $data = array(
        'status' => 'pending',
    );

    $jsonData = json_encode($data);

    $apiToken = 'MY_API_TOKEN';

    $url = 'https://events.unl.edu/api/v2/calendar/3809/event/status/';
    $headers = array(
        'Content-Type: application/json',
        'Authentication: ' . $apiToken,
    );

    // Initialize cURL session
    $ch = curl_init();

    // Set cURL options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
    curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    // Execute cURL session and get the response
    $response = curl_exec($ch);

    // Check if cURL request was successful
    if ($response === false) {
        // Handle cURL error
        echo 'cURL Error: ' . curl_error($ch);
    } else {
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if ($httpCode === 200) {
            // Successful response
            $responseData = json_decode($response, true);
            var_dump($responseData);
        } else {
            // Error response
            echo 'API Error: ' . $response;
        }
    }

    // Close cURL session
    curl_close($ch);
}

Delete

DELETE http://events.unl.edu/api/v2/calendar/{calendar_id}/event/{event_id}/

This endpoint is for deleting a specific calendar event based on its ID.

HTTP Method


DELETE

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


  • calendar_id string | number Required Path
    ID or shortname of the calendar the event will be in. This will go into the path of the request.
  • event_id number Required Path
    ID the event to be looked up. This will go into the path of the request.

Response Data


  • Status number
    Status code for the request.
  • Message string
    Status message for the request.
  • Data null
    This will never have data to return.

Example Code


Javascript
async function eventsAPI() {
    // Sends request with method, headers, and data
    const response = await fetch(
        'https://events.unl.edu/api/v2/calendar/3809/event/12345/',
        {
            method: 'DELETE',
            headers: {
                'Authentication': MY_API_TOKEN,
            }
        }
    );

    // 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 DELETE https://events.unl.edu/api/v2/calendar/3809/event/12345/ \
-H "Authentication: MY_API_TOKEN"
PHP
function eventsAPI() {

    $apiToken = 'MY_API_TOKEN';

    $url = 'https://events.unl.edu/api/v2/calendar/3809/event/12345/';
    $headers = array(
        'Authentication: ' . $apiToken,
    );

    // Initialize cURL session
    $ch = curl_init();

    // Set cURL options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

    // Execute cURL session and get the response
    $response = curl_exec($ch);

    // Check if cURL request was successful
    if ($response === false) {
        // Handle cURL error
        echo 'cURL Error: ' . curl_error($ch);
    } else {
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        if ($httpCode === 200) {
            // Successful response
            $responseData = json_decode($response, true);
            var_dump($responseData);
        } else {
            // Error response
            echo 'API Error: ' . $response;
        }
    }

    // Close cURL session
    curl_close($ch);
}
Contributed By: 
DXG