npm package: @ikonintegration/mod-classroom-client
Description: Classroom module API client
Author: Ikon Integration
Latest version: 1.0.2

# module-classroom-client ![Node.js Package](https://github.com/ikon-integration/module-classroom-client/workflows/Node.js%20Package/badge.svg)

Classroom Module Client (LMS exclusive)

### Overall

- ![npm](https://img.shields.io/npm/dy/@ikonintegration/mod-classroom-client) ![npm](https://img.shields.io/npm/v/@ikonintegration/mod-classroom-client) ![npm (tag)](https://img.shields.io/npm/v/@ikonintegration/mod-classroom-client/latest) ![Libraries.io dependency status for latest release, scoped npm package](https://img.shields.io/librariesio/release/npm/@ikonintegration/mod-classroom-client)
- ![GitHub commit activity](http://sprice.redirectme.net:8555/github/commit-activity/m/ikon-integration/module-classroom-client)
- ![GitHub last commit](http://sprice.redirectme.net:8555/github/last-commit/ikon-integration/module-classroom-client)

### How to Use

```
import SMClassroom from '@ikonintegration/mod-classroom-client';

const API = new SMClassroom({
  port: 9090, //optional
  endpoint: SharedModules_ClassroomEndpoint,

  //Must be specified when using service routes
  apiKey: config.examProvider.key, //API token on IDM.AppID format (generate from APIKey at https://runkit.com/gwdp/idm-appid-v1)

  //Must be specified if not using 'apiKey'
  authorizationToken: '', -- optional, IDM JWT for admins, instructos and user routes -- Accepts a function to be called async and return the token

  //Required if calling on customer scope
  customerID: '',
    //Should be one or another (customer admin mode, or tenant mode (tenant admins, instructors and users))
  tenantID: ''
});

//Do something
const resp = await API.session.createSession(sessionObj);
if (!resp || resp.statusCode != 200) {
  return ERROR:
} return SUCCESS;

```

### Available API methods

**City:**

- API.city.createCity(cityObj) - All Admin and Service
- API.city.updateCity(cityObj) - All Admin and Service
- API.city.deleteCity(cityObj) - Customer Admin and Sys Admin
- API.city.getCity(cityObj) - All Admin and Service
- API.city.getAllCities() - All Admin and Service

**Course:**

- API.course.getAllCourses() - All

**CourseTicket:**

- API.courseTicket.createCourseTicket(courseID, studentID) - All Admin and Service
- API.courseTicket.deleteCourseTicket(courseID, studentID, ticketID) - All Admin and Service
- API.courseTicket.getCourseTicket(courseID, studentID, ticketID) - All

**Instructor:**

- API.instructor.createInstructor(instructorObj) - All Admin and Service
- API.instructor.updateInstructor(instructorObj) - All Admin and Service
- API.instructor.deleteInstructor(instructorID) - Customer Admin and Sys Admin
- API.instructor.getInstructor(instructorID) - All Admin and Service
- API.instructor.getAllInstructors() - All Admin and Service
- API.instructor.createInstructorCourse(instructorCourseObj) - Instructor, All Admin and Service
- API.instructor.getInstructorCourse(instructorID) - Instructor, All Admin and Service
- API.instructor.createInstructorRegion(instructorRegionObj) - Instructor, All Admin and Service
- API.instructor.getInstructorRegion(instructorID) - Instructor, All Admin and Service
- API.instructor.getInstructorEvents(instructorID, { startTime, endTime, expandSessions }) - Instructor, All Admin and Service

**InstructorCalendar:**

- API.instructorCalendar.createAvailabilityEvent(availabilityEventObj) - Instructor, All Admin and Service
- API.instructorCalendar.deleteAvailabilityEvent(instructorID, startTime) - Instructor, All Admin and Service
- API.instructorCalendar.getAvailabilityEvent(instructorID, startTime) - Instructor, All Admin and Service
- API.instructorCalendar.getEvents(instructorID, listObj) - Instructor, All Admin and Service

**InstructorCalendarSync:**

- API.instructorCalendarSync.createInstructorCalendarSync(instructorCalendarSyncObj) - Instructor, All Admin and Service
- API.instructorCalendarSync.updateInstructorCalendarSync(instructorCalendarSyncObj) - Instructor, All Admin and Service
- API.instructorCalendarSync.deleteInstructorCalendarSync(instructorID, providerID) - Instructor, All Admin and Service
- API.instructorCalendarSync.getInstructorCalendarSync(instructorID, providerID) - Instructor, All Admin and Service
- API.instructorCalendarSync.getInstructorCalendarSyncsByInstructorID(instructorID) - Instructor, All Admin and Service

**Locations:**

- API.locations.getAllLocations() - All

**Region:**

- API.region.createRegion(regionObj) - All Admin and Service
- API.region.updateRegion(regionObj) - All Admin and Service
- API.region.deleteRegion(regionID) - Customer Admin and Sys Admin
- API.region.getRegion(regionID) - All Admin and Service
- API.region.getAllRegions() - All Admin and Service

**Report:**

- API.report.sessionResultsAnalysis(courseID, instructorID, from, to) - All Admin and Service
- API.report.sessionResults(dateFrom, dateTo, courseIDs, from, isPreview) - All Admin and Service
- API.report.sessionList(from, to, state, courseID, instructorID) - All Admin and Service
- API.report.sessionCharges(sessionID) - All Admin and Service

**Session:**

- API.session.createSession(sessionObj) - All Admin and Service
- API.session.updateSession(sessionID, sessionObj) - All Admin and Service
- API.session.deleteSession(sessionID) - All Admin and Service
- API.session.getSession(sessionID, expanded) - All
- API.session.getSessionList(startTime, endTime, optionalCourseID, optExcludeOnline) - All
- API.session.getCustomerSessionList(startTime, endTime, optExcludeOnline) - All
- API.session.transitionSessionState(sessionID) - Instructor, All Admin and Service
- API.session.lockSession(sessionID) - All Admin and Service
- API.session.publishSession(sessionID, published) - All Admin and Service
- API.session.cancelSession(sessionID) - All Admin and Service
- API.session.releaseSession(sessionID) - Instructor, All Admin and Service
- API.session.updateSessionMaterialShipStatus(sessionID, shipFlag) - All Admin and Service
- API.session.createSessionInstructor(sessionID, instructorID, instructorType) - All Admin and Service
- API.session.updateSessionInstructor(sessionID, instructorID, instructorType) - All Admin and Service
- API.session.deleteSessionInstructor(sessionID, instructorID) - Instructor, All Admin and Service
- API.session.getSessionInstructor(sessionID, instructorID) - All
- API.session.createDocument(sessionID, file) - Instructor, All Admin and Service
- API.session.deleteDocument(sessionID, file) - Instructor, All Admin and Service
- API.session.batchUpdateSessionAttendanceAndResults(sessionID, body) - Instructor, All Admin and Service
- API.session.moveStudentSession(sessionID, userID, newSessionID) - All Admin and Service
- API.session.getSessionUserData(sessionID, userID, externalID) - All
- API.session.duplicateSession(sessionID) - All Admin and Service

**Session File:**

- API.sessionFile.uploadAndCreateDocument(sessionID, file) - Instructor, All Admin and Service
- API.sessionFile.download(sessionID, fileID) - Instructor, All Admin and Service
- API.sessionFile.delete(sessionID, fileID) - Instructor, All Admin and Service

**SessionAttendance:**

- API.sessionAttendance.createSessionAttendance(sessionID, attendanceID, externalID, attendanceObj) - Instructor, All Admin and Service
- API.sessionAttendance.updateSessionAttendance(sessionID, attendanceID, externalID, attendanceObj) - Instructor, All Admin and Service
- API.sessionAttendance.deleteSessionAttendance(sessionID, attendanceID, externalID) - Instructor, All Admin and Service
- API.sessionAttendance.getSessionAttendance(sessionID, attendanceID, externalID) - All
- API.sessionAttendance.getSessionAttendancesBySessionID(sessionID) - Instructor, All Admin and Service

**SessionAttendance:**

- API.sessionCharge.getSessionChargeByUserIDAndTimestamp(sessionID, userID, timestamp) - All Admin and Service
- API.sessionCharge.getSessionChargesByUserID(sessionID, userID) - All Admin and Service

**SessionEnrolment:**

- API.sessionEnrolment.createSessionEnrolment(sessionID, enrolmentID, externalID, enrolmentObj) - All
- API.sessionEnrolment.updateSessionEnrolment(sessionID, enrolmentID, externalID, enrolmentObj) - Instructor, All Admin and Service
- API.sessionEnrolment.deleteSessionEnrolment(sessionID, enrolmentID, externalID) - Instructor, All Admin and Service
- API.sessionEnrolment.getSessionEnrolment(sessionID, enrolmentID, externalID) - All
- API.sessionEnrolment.getSessionEnrolmentsBySessionID(sessionID) - Instructor, All Admin and Service
- API.sessionEnrolment.getSessionEnrolmentBySessionIDAndUserID(sessionID, enrolmentID) - All
- API.sessionEnrolment.releaseSessionEnrolment(sessionID, enrolmentID, externalID) - Instructor, All Admin and Service
- API.sessionEnrolment.checkSessionEnrolmentResults(sessionID, enrolmentID, externalID) - All
- API.sessionEnrolment.launchSessionEnrolment(sessionID, enrolmentID, externalID, ssoObj) - All
- API.sessionEnrolment.cancelSessionEnrolment(sessionID, enrolmentID, externalID) - Instructor, All Admin and Service
- API.sessionEnrolment.chargeSessionEnrolment(sessionID, enrolmentID, externalID, chargeObj) - All Admin and Service

**SessionInvitation:**

- API.sessionInvitation.createSessionInvitation(sessionID, invitationID, enrolmentInvitationObj) - All Admin and Service
- API.sessionInvitation.updateSessionInvitation(sessionID, invitationID, enrolmentInvitationObj) - All Admin and Service
- API.sessionInvitation.deleteSessionInvitation(sessionID, invitationID) - All Admin and Service
- API.sessionInvitation.getSessionInvitation(sessionID, invitationID) - All Admin and Service
- API.sessionInvitation.getSessionInvitationsBySessionID(sessionID) - All Admin and Service
- API.sessionInvitation.validateSessionInvitation(sessionID, invitationCode) - All Admin and Service

**SessionResult:**

- API.sessionResult.createSessionResult(sessionID, resultID, externalID, resultObj) - Instructor, All Admin and Service
- API.sessionResult.updateSessionResult(sessionID, resultID, externalID, resultObj) - Instructor, All Admin and Service
- API.sessionResult.deleteSessionResult(sessionID, resultID, externalID) - Instructor, All Admin and Service
- API.sessionResult.getSessionResult(sessionID, resultID, externalID) - All
- API.sessionResult.getSessionResultsBySessionID(sessionID) - Instructor, All Admin and Service

**Template:**

- API.template.createTemplate(templateObj) - Customer Admin and Sys Admin
- API.template.updateTemplate(templatedID, templateObj) - All Admin and Service
- API.template.deleteTemplate(templateID) - Customer Admin and Sys Admin
- API.template.getTemplate(templateID) - All Admin and Service
- API.template.getTemplates() - All Admin and Service

**Venue:**

- API.venue.createVenue(venueObj) - All Admin and Service
- API.venue.updateVenue(venueObj) - All Admin and Service
- API.venue.deleteVenue(venueID) - Customer Admin and Sys Admin
- API.venue.getVenue(venueID) - All Admin and Service
- API.venue.getAllVenues() - All Admin and Service