Help with API call
Ever since implementing the Cireson Portal, and seeing some of the customizations, I've been drawn to learning more about web development. My manager asked me to see if there was a way to have a calendar display CRs according to their End Date, for better visibility. I wasn't sure if there was something built in for this, and honestly, I found it to be a good opportunity to take a crack at developing my own solution.
So far, I have a page that displays a calendar and references a JS file. I have static JSON data in the JS file, which I loop through to find CR data and add it as links to the calendar page. While that is all working fine, it's static. I've been around the forums and various JS tutorials looking for how to make the API call correctly. Also, keep in mind that I've only learned some vanilla JS so far, no jQuery.
Whenever I run the code that I think could work, I receive an error that "session" is not defined. Here's a snippet of what the code I'm trying to run. I assume that it is wrong, let me get that out of the way, but it feels like I'm close. Anyone here that can help fill in my knowledge gap?
Thanks for the help!