Breadcrumbs

Moodle - API Integration

Introduction

Welcome to the HelioCampus Moodle API Integration Guide. This document provides step-by-step instructions for configuring the integration between HelioCampus Assessment & Credentialing and Moodle using API standards and completing the HelioCampus Assessment & Credentialing LMS Information Form.

HelioCampus Moodle API Token

A Moodle API Developer Key is required to enable HelioCampus to retrieve data from Moodle for use in HelioCampus Assessment & Credentialing.

Generating a Moodle API Token

A Moodle Administrator must generate an API Token within the institution's Moodle instance by following these steps:

1. Enable Web services

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Advanced Features.

  3. Find and check the Enable web services box.

  4. Click Save Changes.

2. Enable API Protocols

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Server → Web Services.

  3. Select Manage Protocols.

  4. Find REST protocol then select Enable.

  5. Click Save Changes.

HelioCampus Moodle Service Account

This section outlines the steps to create a service account for REST API calls between Moodle environment and HelioCampus Assessment & Credentialing. This integration enables HelioCampus to gather necessary data for assessment purposes. The following steps must be completed by a Moodle Administrator and a HelioCampus Institutional Admin at your institution.

1. Create the Service Account

Create an account in Moodle , following your institution’s policies.
Ensure that the account setup follows the same format as other user accounts.

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Users → Accounts.

  3. Select Add a new user.

  4. In the Add a new user dialog, enter the following details:

Field

Value

Username

heliocampusserviceaccount

Suspended account

Leave unchecked.

Generate password and notify user

Leave unchecked.

New password

Create a strong password for the service account and be sure to securely record it.

First Name

HelioCampus Moodle

Surname

Service Account

Email Address

This does not need to be a real email, we suggest heliocampusserviceaccount@<YOUR INSTITUTION EMAIL DOMAIN>.edu

Email Display

Choose Hide my email address from non-privileged users.

MoodleNet profile

Leave blank.

City/town

Leave blank.

Select a country

Choose United States.

Preferred language

Choose English

Description

Type “Service account for HelioCampus Assessment & Credentialing API integration”

User picture

Leave all items blank.

Additional names

Leave all items blank.

Interests

Leave all items blank.

Optional

Leave all items blank.

  1. Click Create User

  2. Click Add User

2. Create a Custom Role

Create an Custom Role that grants the service account the necessary permissions.

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Users → Permissions.

  3. Select Define Roles.

  4. Click Add a new role.

  5. Find Use role or archetype then select Teacher.

  6. Click Continue.

  7. In the Add a new role dialog, enter the following details:

Field

Value

Short name

heliocampusservicerole

Custom full name

HelioCampus Service Role

Custom description

Type “Service account role for HelioCampus Assessment & Credentialing API integration”

Role archetype

Leave as is.

Context types where this role may be assigned

Leave as is.

Allow role assignments

Leave as is.

Allow role overrides

Leave as is.

Allow role switches

Leave as is.

Allow role to view

Leave as is.

Capability

At a minimum this role needs the following capabilities enabled, to accomplish this do the following for each capability:

  1. Copy the value from Value for the capability.

  2. Paste the Value in Filter.

  3. Click Allow.

  4. Click Clear and repeat until complete.

Capability

Value

Create a web service token

moodle/webservice:createtoken

Manage all users' web service tokens

moodle/webservice:managealltokens

Use REST protocol

webservice/rest:use

See full user identity in lists

moodle/site:viewuseridentity

View user full information

moodle/user:viewalldetails

View courses without participation

moodle/course:view

View assignment

mod/assign:view

View grades

mod/assign:viewgrades

  1. Click Create this Role.

3. Assign the Service Role to the Service Account

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Users → Permissions.

  3. Select Assign system roles.

  4. Under Role find then click on HelioCampus Service Role.

  5. Under Potential users, paste heliocampusserviceaccount in Search.

  6. Under Potential users select HelioCampus Moodle Service Account

  7. Click Add

4. Make Service Account a Site Administrator

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Users → Permissions.

  3. Select Site administrators.

  4. Under Role find then click on HelioCampus Service Role.

  5. Under Potential users, paste heliocampusserviceaccount in Search.

  6. Under Potential users select HelioCampus Moodle Service Account

  7. Click Add

5. Create External Service

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Server → Web Services.

  3. Select External services.

  4. Click Add.

  5. In the Add External Service dialog, enter the following details:

Field

Value

Name

HelioCampus External Service

Short name

heliocampusexternalservice

Enabled

Check this box.

Authorised users only

Check this box.

Can download files

Check this box.

Can upload files

Leave unchecked.

  1. Click Add Service.

6. Add functions to the External Service

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Server → Web Services.

  3. Select External services.

  4. Find HelioCampus External Service click Functions.

  5. Scroll to the bottom the select Add functions.

  6. In the Name drop-down find and select the following functions:

    • core_course_get_courses_by_field

    • core_enrol_get_enrolled_users

    • mod_assign_get_assignments

    • gradereport_user_get_grade_items

    • mod_assign_get_submissions

    • core_grading_get_definitions

  7. Click Add Functions.

7. Add Service Account to the External Service

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Server → Web Services.

  3. Select External services.

  4. Find HelioCampus External Service click Authorised users.

  5. Under Not authorised users, paste heliocampusserviceaccount in Search.

  6. Under Not authorised users select HelioCampus Moodle Service Account

  7. Click Add.

8. Create Token for Service Account/External Service

  1. Log into Moodle as an Admin.

  2. Navigate to Site Administration and select the Server → Web Services.

  3. Select Manage tokens.

  4. Click Add.

  5. In the Create Token dialog, enter the following details:

Field

Value

User

Click the drop-down then select HelioCampus Moodle Service Account.

Short name

Click the drop-down then select HelioCampus External Service

IP restriction

Leave blank.

Valid until

Leave blank.

  1. Click Save Changes.

  2. Copy the Token and paste it into the API Token field on the HelioCampus Assessment & Credentialing LMS Information Form.

Submitting the HelioCampus Assessment and Credentialing LMS Information Form.

If you have also completed the API integration steps, you may now submit the HelioCampus Assessment and Credentialing LMS Information Form

Once all steps are completed, return to the main Moodle guide to finalize the integration.