I would also highly recommend looking at an example by Jason: About the Events Category
Use the “Create Event” function.