Skill Level:
Advanced
This API endpoint will return a list of all the available event types.
Available Methods
Read
GET http://events.unl.edu/api/v2/eventtypes/
This endpoint is for getting a list of all the available event types.
HTTP Method
GET
Authentication Requirements
None
Request Data
None
Response Data
Example Code
Javascript
async function eventsAPI() { const response = await fetch('https://events.unl.edu/api/v2/eventtypes/'); if (response.ok) { const response_json = await response.json(); console.log(response_json.data); } }
CURL
curl -X GET 'https://events.unl.edu/api/v2/eventtypes/'
PHP
function eventsAPI() { $url = 'https://events.unl.edu/api/v2/eventtypes/'; // 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'; } }
Contributed By:
DXG
- Printer-friendly version
- Log in to post comments