1.0.0-alpha5 • Published 10 months ago

@ikonintegration/mod-courses-client v1.0.0-alpha5

Weekly downloads
12
License
-
Repository
-
Last release
10 months ago

module-auditing-client Node.js Package

Courses module nodejs API client

Overall

  • npm npm npm (tag) Libraries.io dependency status for latest release, scoped npm package
  • GitHub commit activity
  • GitHub last commit

How to Use

import SMCourses from '@ikonintegration/mod-courses-client';

const API = new SMCourses({
  //those 3 need to be provided
  endpoint: SharedModules_CoursesEndpoint,
  //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)
  //Must be specified when using admin or user routes
  authorizationToken: '', -- optional, IDM JWT for shared module admins and user routes -- Accepts a function to be called async and return the token
  namespace: '' 
});

//Create or update user
const resp = API.user.createOrUpdateUser({
          user: {
            firstName: 'Gabriel', lastName: 'Pacheco',
            email: 'gabriel.xx@gmail.com', id: 'IDM-ID'
          }
    }
);
if (!resp || resp.statusCode != 200) {
  return ERROR:
} return SUCCESS;

//Enroll user into course or update user
const resp = API.course.enrollUser(userID, courseID);
if (!resp || resp.statusCode != 200) {
  return ERROR:
} return SUCCESS;

//SSO
const resp = API.course.generateSSO(userID, courseID, optionalCallbackURL);
if (!resp || resp.statusCode != 200) {
  return ERROR:
} return resp.body.url;

Headers

The following 2 headers must be specified in every request!

  • ProviderID
  • Authorization

Available API methods

User:

  • API.user.createOrUpdateUser(userObj)
  • API.user.updateUser(userObj)

Course:

  • API.course.enrollUser(userID, courseID, optionalQuizID)
  • API.course.unrollUser(userID, courseID, optionalQuizID)
  • API.course.generateSSO(userID, courseID, callbackURL /optional/)
  • API.course.getGrade(userID, courseID, gradeID)
1.0.0-alpha5

10 months ago

1.0.0-alpha1

10 months ago

1.0.0-alpha2

10 months ago

1.0.0-alpha3

10 months ago

1.0.0-alpha4

10 months ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago