by Joshua Parker.
Never mind, I got it working. Once I made a change to params: $params = array('courses'=> $MoodleCourses); I could see some other errors that needed to be corrected, and afterwards it worked.