Submit a ticket My Tickets
Welcome
Login

NexSIS API

TABLE OF CONTENTS

NexSIS API Introduction

MoodleUS NexSIS API is a RESTful API that facilitates realtime integrations between Moodle and 3rd party systems, especially management information systems such as student information systems (SIS), human resources information systems (HRIS), and customer relationship management systems (CRM).

Why not Moodle core external services?

It is true that Moodle comes with external services available out of the box. These work well for their specific purpose; however, we have found that they are neither well geared towards nor designed for integration with a management information system. For example, they do not facilitate bulk operations, and they operate on the unique identifiers of the Moodle system.

MoodleUS has designed the NexSIS API from the ground up. Some of the key differences with Moodle's built-in external services are:

  • Simpler, more streamlined API calls geared towards a management information system
  • Facilitation of both individual and bulk operations
  • Operations performed on the unique identifiers of the external system

Requests

Authentication

Header authentication example:

GET /enrol/nexsis/api/index.php/ping HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Query parameter example:

GET /enrol/nexsis/api/index.php/ping?token={token} HTTP/1.1
        Host: example.moodle.com
        Accept: */*
        

NexSIS uses API keys to allow access to the API. You can enable the API and generate an API Key in the plugin's Moodle administration area.

NexSIS expects for the API key to be included in all API requests to the service. You have the option of passing the key in an Authorization header or as a query parameter named token.

The authorization header must follow the following format, where {token} is your API key:

Authorization: Bearer {token}

You must replace {token} with your API key.

HTTP Verbs

NexSIS API is a RESTful API and operates using the standard HTTP verbs. A brief description of each follows:

VerbDescription
GETretrieve a resource
POSTcreate a new resource
PUTupdate a resource
DELETEdelete or remove a resource
NexSIS considers the management information system to be the master record of some resources. Therefore, those resources do not support the POST verb. Since the resources already exist and have a unique identifier, and Moodle just has a copy of the resource, both Moodle creation and update use the PUT verb.

Sending Data

Example request (JSON):

PUT /enrol/nexsis/api/index.php/enpoint HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/json

        {
          "param1": "value1",
          "param2": "value2",
        }
        

Example request (URL-encoded):

PUT /enrol/nexsis/api/index.php/enpoint HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/x-www-form-urlencoded

        param1=value1&param2=value2
        

When sending data to the API, you can choose whether to send data in JSON or in URL-encoded format.

When sending JSON data, be sure to set the Content-Type header to application/json

Responses

Unless otherwise noted or specified, all responses from the NexSIS API are JSON encoded format.

Health Checks

Ping

Endpoint:

GET /enrol/nexsis/api/index.php/ping
        

Example request:

GET /enrol/nexsis/api/index.php/ping HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "message": "pong"
        }
        

This endpoint can be used to ping the API in order to determine its operational status.

Courses

Get a Course

Endpoint:

GET /enrol/nexsis/api/index.php/course/{courseid}
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "courseid": "C789",
          "fullname": "Principles of API Design",
          "shortname": "TECH-231"
          "startdate": "2017-08-16T21:09:30+00:00",
          "categorypath": "/Technology/Design/Modern Programming"
        }
        

This endpoint retrieves a course.

URL Parameters

ParameterType
courseid
The identifier of the course to retrieve.
string

Create/Update a Course

Endpoint:

PUT /enrol/nexsis/api/index.php/course/{courseid}
        

Example request (JSON):

PUT /enrol/nexsis/api/index.php/course/C789 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/json

        {
          "fullname": "Principles of API Design",
          "shortname": "TECH-231"
          "startdate": "2017-08-16T21:09:30+00:00",
          "categorypath": "/Technology/Design/Modern Programming"
          "templateid": "C101"
        }
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "courseid": "C789",
          "fullname": "Principles of API Design",
          "shortname": "TECH-231"
          "startdate": "2017-08-16T21:09:30+00:00",
          "categorypath": "/Technology/Design/Modern Programming"
        }
        

This endpoint creates or updates a course.

URL Parameters

ParameterType
courseid
The identifier of the course to create or update.
string

Body/JSON Parameters

ParameterTypeRequired
fullname
The full name of the course.
stringYes
shortname
A shortened or abbreviated name for the course
stringNo
startdate
The start date & time of the course.
datetimeNo
categorypath
Category node to place the course in, represented as a URI path.
stringNo
templateid
The identifier of the course template or shell to use when creating the course for the first time in Moodle
stringNo

Delete a Course

Endpoint:

DELETE /enrol/nexsis/api/index.php/course/{courseid}
        

Example request:

DELETE /enrol/nexsis/api/index.php/course/C789 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8
        

This endpoint deletes a course.

URL Parameters

ParameterType
courseid
The identifier of the course to delete.
string

List Enrolments in a Course

Endpoint:

GET /enrol/nexsis/api/index.php/course/{courseid}/enrol
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789/enrol HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        [
            {
                "userenrol_id": "6",
                "enrol": "manual",
                "enrolstatus": "0",
                "enrolstartdate": "0",
                "enrolenddate": "0",
                "firstname": "Test",
                "lastname": "User",
                "email": "tuser@example.com",
                "idnumber": "U19913",
                "role": "Student"
            },
            {
                "userenrol_id": "4",
                "enrol": "nexsis",
                "enrolstatus": "0",
                "enrolstartdate": "0",
                "enrolenddate": "0",
                "firstname": "Test2",
                "lastname": "User",
                "email": "t2user@example.com",
                "idnumber": "U14845",
                "role": "Student"
            }
        ]

        

URL Parameters

ParameterType
courseid
The identifier of the course.
string

Get Category Grades

Endpoint:

GET /enrol/nexsis/api/index.php/course/{courseid}/categorygrade/{catid}
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789/categorygrade/6 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        [
            {
                "user_idnumber": "u12345",
                "itemid": "2",
                "internal_userid": "5",
                "rawgrade": null,
                "rawgrademax": "100.00000",
                "rawgrademin": "0.00000",
                "rawscaleid": null,
                "usermodified": null,
                "finalgrade": "80.00000",
                "hidden": "0",
                "locked": "0",
                "locktime": "0",
                "exported": "0",
                "overridden": "0",
                "excluded": "0",
                "feedback": null,
                "feedbackformat": "0",
                "information": null,
                "informationformat": "0",
                "timecreated": null,
                "timemodified": "1590008438",
                "aggregationstatus": "used",
                "aggregationweight": "0.50000",
                "gradeid": "6",
                "categoryid": "2"
            },
            {
                "user_idnumber": "u67890",
                "itemid": "2",
                "internal_userid": "4",
                "rawgrade": null,
                "rawgrademax": "100.00000",
                "rawgrademin": "0.00000",
                "rawscaleid": null,
                "usermodified": null,
                "finalgrade": "40.00000",
                "hidden": "0",
                "locked": "0",
                "locktime": "0",
                "exported": "0",
                "overridden": "0",
                "excluded": "0",
                "feedback": null,
                "feedbackformat": "0",
                "information": null,
                "informationformat": "0",
                "timecreated": null,
                "timemodified": "1590518968",
                "aggregationstatus": "used",
                "aggregationweight": "0.50000",
                "gradeid": "12",
                "categoryid": "2"
            }
        ]
        

URL Parameters

ParameterType
courseid
The identifier of the course.
string
catid
The identifier of the grade category.
int

Optional GET Parameters

Example using GET parameter to filter by user IDs:

GET /enrol/nexsis/api/index.php/course/C789/categorygrades/3?userid[]=u12345&userid[]=u67890
        
KeyValue
userid[]User IDs to filter by. This is an array parameter, so you can pass multiple userid[]s.

Override Category Grades

Endpoint:

PUT /enrol/nexsis/api/index.php/course/{courseid}/categorygrade/{catid}/{userid}/{grade}
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789/categorygrade/6/U12345/80 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
            "user_idnumber": "eli",
            "id": "8",
            "itemid": "4",
            "internal_userid": "5",
            "rawgrade": null,
            "rawgrademax": "100.00000",
            "rawgrademin": "0.00000",
            "rawscaleid": null,
            "usermodified": null,
            "finalgrade": "80.00000",
            "hidden": "0",
            "locked": "0",
            "locktime": "1590520163",
            "exported": "0",
            "overridden": "1590520163",
            "excluded": "0",
            "feedback": null,
            "feedbackformat": "0",
            "information": null,
            "informationformat": "0",
            "timecreated": null,
            "timemodified": "1590008571",
            "aggregationstatus": "used",
            "aggregationweight": "0.50000"
        }

        

URL Parameters

ParameterType
courseid
The identifier of the course.
string
catid
The identifier of the grade category.
int
userid
The user whose grade is being overriden
string
grade
Numerical grade value
(any numerical type)

Optional GET Parameters

Example using an optional GET parameter to lock the grade:

PUT /enrol/nexsis/api/index.php/course/C789/categorygrades/3/U12345/80?lock=true
        
KeyValue
lockset to true or 1 to lock the grade. This will prevent further modifications using the frontend.

Users

Get a User

Endpoint:

GET /enrol/nexsis/api/index.php/user/{userid}
        

Example request:

GET /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "userid": "S123",
          "username": "student123",
          "firstname": "Student",
          "lastname": "Smith",
          "email": "studentsmith@inst.edu"
        }
        

This endpoint retrieves a user.

URL Parameters

ParameterType
userid
The identifier of the user to retrieve.
string

Create/Update a User

Endpoint:

PUT /enrol/nexsis/api/index.php/user/{userid}
        

Example request (JSON):

PUT /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/json

        {
          "username": "student123",
          "firstname": "Student",
          "lastname": "Smith",
          "email": "studentsmith@inst.edu"
        }
        

Example request (URL-encoded):

PUT /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/x-www-form-urlencoded

        username=student123&firstname=Student&lastname=Smith&email=studentsmith%40inst.edu
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "userid": "S123",
          "username": "student123",
          "firstname": "Student",
          "lastname": "Smith",
          "email": "studentsmith@inst.edu"
        }
        

This endpoint creates or updates a user.

URL Parameters

ParameterType
userid
The identifier of the user to create or update.
string

Body/JSON Parameters

ParameterTypeRequired
username
The Moodle username of the user.
stringYes
firstname
The user's first name.
stringYes
lastname
The user's last name.
stringYes
email
The user's email address.
stringYes
auth
The user's authentication method.
Default: manual
stringNo
lang
The user's preferred language.
Default: site's default language
stringNo
password
The user's password.
Note: May be passed as plain text or an MD5 hash
stringNo
timezone
The user's timezone.
Default: site's default timezone
stringNo
urlstringNo
institutionstringNo
departmentstringNo
addressstringNo
citystringNo
countrystringNo
icqstringNo
skypestringNo
yahoostringNo
aimstringNo
msnstringNo
phone1stringNo
phone2stringNo
policyagreed
Default: false
booleanNo
middlenamestringNo
alternatenamestringNo

Delete a User

Endpoint:

DELETE /enrol/nexsis/api/index.php/user/{userid}
        

Example request:

DELETE /enrol/nexsis/api/index.php/user/S123 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8
        

This endpoint deletes a user.

URL Parameters

ParameterType
userid
The identifier of the user to delete.
string

Enrolments

List User Enrolments

Endpoint:

GET /enrol/nexsis/api/index.php/user/{userid}/enrol
        

Example request:

GET /enrol/nexsis/api/index.php/user/S123/enrol HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        [
          {
            "courseid": "C789",
            "fullname": "Principles of API Design",
            "shortname": "TECH-231"
            "startdate": "2017-08-16T21:09:30+00:00",
            "roles": [
              "student"
            ]
          },
          {
            "courseid": "C889",
            "fullname": "Principles of API Design II",
            "shortname": "TECH-331"
            "startdate": "2017-08-16T21:09:30+00:00",
            "roles": [
              "student"
            ]
          }
        ]
        

This endpoint retrieves all enrolments for a user.

URL Parameters

ParameterType
userid
The identifier of the user.
string

Optional GET Parameters

Example using GET parameter to list only NexSIS enrollments:

GET /enrol/nexsis/api/index.php/user/{userid}/enrol?plugin=nexsis
        
KeyValue
pluginEnrolment plugin to filter by, e.g. "nexsis" or "manual"

Enrol a User in a Course

Endpoint:

PUT /enrol/nexsis/api/index.php/user/{userid}/enrol/{courseid}
        

Example request:

POST /enrol/nexsis/api/index.php/user/S123/enrol/C789 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/json

        {
          "roleid": "student"
        }
        

This endpoint creates or updates a user enrolment in a course.

URL Parameters

ParameterType
userid
The identifier of the user to enrol.
string
courseid
The identifier of the course to be enroled in.
string

Body/JSON Parameters

ParameterTypeRequired
roleid
The identifier of the role to assign the user in the course.
stringNo
timestart
Date & time that the user's enrolment begins.
datetimeNo
timeend
Date & time that the user's enrolment ends.
datetimeNo

Unenrol a User from a Course

Endpoint:

DELETE /enrol/nexsis/api/index.php/user/{userid}/enrol/{courseid}
        

Example request:

DELETE /enrol/nexsis/api/index.php/user/S123/enrol/C789 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

This endpoint unenrols a user from a course.

URL Parameters

ParameterType
userid
The identifier of the user to unenrol.
string
courseid
The identifier of the course to be unenroled from.
string

Optional GET Parameters

Example using optional GET parameter to delete only NexSIS enrolments:

DELETE /enrol/nexsis/api/index.php/user/{userid}/enrol/{courseid}?plugin=nexsis
        
KeyValue
pluginEnrolment plugin to filter by, e.g. "nexsis" or "manual"

Course Groups

List Course Groups

Endpoint:

GET /enrol/nexsis/api/index.php/course/{courseid}/group
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789/group HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        [
          {
            "groupid": "G1",
            "name": "Group 1",
            "description": "Group 1..."
          },
          {
            "groupid": "G2",
            "name": "Group 2",
            "description": "Group 2..."
          },
          {
            "groupid": "G3",
            "name": "Group 3",
            "description": "Group 3..."
          }
        ]
        

This endpoint retrieves all groups for a given course.

URL Parameters

ParameterType
courseid
The identifier of the course to retrieve a list of groups for.
string

Get a Course Group

Endpoint:

GET /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789/group/G1 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "groupid": "G1",
          "name": "Group 1",
          "description": "Group 1..."
        }
        

This endpoint retrieves a group for a given course.

URL Parameters

ParameterType
courseid
The identifier of the course that the group is in.
string
groupid
The identifier of the group.
string

Create/Update a Course Group

Endpoint:

PUT /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}
        

Example request (JSON):

PUT /enrol/nexsis/api/index.php/course/C789/group/G1 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        Content-Type: application/json

        {
          "name": "Group 1",
          "description": "Group 1..."
        }
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "groupid": "G1",
          "name": "Group 1",
          "description": "Group 1..."
        }
        

This endpoint creates or updates a course group.

URL Parameters

ParameterType
courseid
The identifier of the course that the group is in.
string
groupid
The identifier of the group to create or update.
string

Body/JSON Parameters

ParameterTypeRequired
name
The name of the group.
stringYes
description
A description for the group
stringNo

Delete a Course Group

Endpoint:

DELETE /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}
        

Example request:

DELETE /enrol/nexsis/api/index.php/course/C789/group/G1 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8
        

This endpoint deletes a course group.

URL Parameters

ParameterType
courseid
The identifier of the course that the group is in.
string
groupid
The identifier of the group to delete.
string

Add/Update a Course Group User

Endpoint:

PUT /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}/user/{userid}
        

Example request (JSON):

PUT /enrol/nexsis/api/index.php/course/C789/group/G1/user/S123 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8
        

This endpoint adds a user to a course group.

URL Parameters

ParameterType
courseid
The identifier of the course that the group is in.
string
groupid
The identifier of the group to add the user to.
string
userid
The identifier of the user to add.
string

Remove a Course Group User

Endpoint:

DELETE /enrol/nexsis/api/index.php/course/{courseid}/group/{groupid}/user/{userid}
        

Example request:

DELETE /enrol/nexsis/api/index.php/course/C789/group/G1/user/S123 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8
        

This endpoint removes a user from a course group.

URL Parameters

ParameterType
courseid
The identifier of the course that the group is in.
string
groupid
The identifier of the group to remove the user from.
string
userid
The identifier of the user to remove.
string

Grades

The NexSIS API retrieves course level grades. These typically correspond to the course "final" grade.

Get User Grades

Endpoint:

GET /enrol/nexsis/api/index.php/user/{userid}/grade
        

Example request:

GET /enrol/nexsis/api/index.php/user/S123/grade HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "meta": {
            "total-pages": 1
          },
          "data": [
            {
              "userid": "S123",
              "courseid": "C789",
              "rawfinalgrade": 92.00,
              "rawgrademax": 100.00,
              "gradeletter": "A-",
              "gradepercent": 0.92,
              "feedback": "Great effort!",
              "timemodified": "2017-08-16T21:09:30+00:00"
            },
            {
              "userid": "S123",
              "courseid": "C799",
              "rawfinalgrade": 950.00,
              "rawgrademax": 1000.00,
              "gradeletter": "A",
              "gradepercent": 0.95,
              "feedback": "Keep it up!",
              "timemodified": "2017-08-15T18:12:21+00:00"
            },
            {
              "userid": "S123",
              "courseid": "C850",
              "rawfinalgrade": 8.40,
              "rawgrademax": 10.00,
              "gradeletter": "B",
              "gradepercent": 0.84,
              "feedback": "",
              "timemodified": "2017-10-02T09:43:54+00:00"
            }
          ]
        }
        

This endpoint retrieves a user's grades.

URL Parameters

ParameterType
userid
The identifier of the user to retrieve grades for.
string

Query String Parameters

ParameterTypeRequired
pagenumber
The page of results to retrieve.
Default: 1
integerNo
pagesize
The number of results per page. The maximum value allowed is 250
Default: 100
integerNo
timestart
The starting date/time to retrieve results from.
Default: 1 Year Ago
datetimeNo
timeend
The ending date/time to retrieve results thru.
Default: Now
datetimeNo

Get Course Grades

Endpoint:

GET /enrol/nexsis/api/index.php/course/{courseid}/grade
        

Example request:

GET /enrol/nexsis/api/index.php/course/C789/grade?pagesize=3 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "meta": {
            "total-pages": 6
          },
          "data": [
            {
              "userid": "S123",
              "courseid": "C789",
              "rawfinalgrade": 92.00,
              "rawgrademax": 100.00,
              "gradeletter": "A-",
              "gradepercent": 0.92,
              "feedback": "Great effort!",
              "timemodified": "2017-08-16T21:09:30+00:00"
            },
            {
              "userid": "S234",
              "courseid": "C789",
              "rawfinalgrade": 82.00,
              "rawgrademax": 100.00,
              "gradeletter": "B-",
              "gradepercent": 0.82,
              "feedback": "",
              "timemodified": "2017-08-16T21:10:30+00:00"
            },
            {
              "userid": "S345",
              "courseid": "C789",
              "rawfinalgrade": 96.00,
              "rawgrademax": 100.00,
              "gradeletter": "A",
              "gradepercent": 0.96,
              "feedback": "Great work!",
              "timemodified": "2017-08-16T21:11:30+00:00"
            }
          ]
        }
        

This endpoint retrieves a course's grades.

URL Parameters

ParameterType
courseid
The identifier of the course to retrieve grades for.
string

Query String Parameters

ParameterTypeRequired
pagenumber
The page of results to retrieve.
Default: 1
integerNo
pagesize
The number of results per page. The maximum value allowed is 250
Default: 100
integerNo
timestart
The starting date/time to retrieve results from.
Default: 1 Year Ago
datetimeNo
timeend
The ending date/time to retrieve results thru.
Default: Now
datetimeNo

Get All Grades

Endpoint:

GET /enrol/nexsis/api/index.php/grade
        

Example request:

GET /enrol/nexsis/api/index.php/grade?pagesize=5 HTTP/1.1
        Authorization: Bearer {token}
        Host: example.moodle.com
        Accept: */*
        

Example response:

HTTP/1.1 200 OK
        Content-Type: application/json; charset=utf-8

        {
          "meta": {
            "total-pages": 60
          },
          "data": [
            {
              "userid": "S123",
              "courseid": "C789",
              "rawfinalgrade": 92.00,
              "rawgrademax": 100.00,
              "gradeletter": "A-",
              "gradepercent": 0.92,
              "feedback": "Great effort!",
              "timemodified": "2017-08-16T21:09:30+00:00"
            },
            {
              "userid": "S234",
              "courseid": "C789",
              "rawfinalgrade": 82.00,
              "rawgrademax": 100.00,
              "gradeletter": "B-",
              "gradepercent": 0.82,
              "feedback": "",
              "timemodified": "2017-08-16T21:10:30+00:00"
            },
            {
              "userid": "S345",
              "courseid": "C789",
              "rawfinalgrade": 96.00,
              "rawgrademax": 100.00,
              "gradeletter": "A",
              "gradepercent": 0.96,
              "feedback": "Great work!",
              "timemodified": "2017-08-16T21:11:30+00:00"
            },
            {
              "userid": "S123",
              "courseid": "C799",
              "rawfinalgrade": 950.00,
              "rawgrademax": 1000.00,
              "gradeletter": "A",
              "gradepercent": 0.95,
              "feedback": "Keep it up!",
              "timemodified": "2017-08-15T18:12:21+00:00"
            },
            {
              "userid": "S123",
              "courseid": "C850",
              "rawfinalgrade": 8.40,
              "rawgrademax": 10.00,
              "gradeletter": "B",
              "gradepercent": 0.84,
              "feedback": "",
              "timemodified": "2017-10-02T09:43:54+00:00"
            }
          ]
        }
        

This endpoint retrieves all grades for the given parameters.

Query String Parameters

ParameterTypeRequired
pagenumber
The page of results to retrieve.
Default: 1
integerNo
pagesize
The number of results per page. The maximum value allowed is 250
Default: 100
integerNo
timestart
The starting date/time to retrieve results from.
Default: 1 Year Ago
datetimeNo
timeend
The ending date/time to retrieve results thru.
Default: Now
datetimeNo

Errors

The NexSIS API uses the following error codes:

Error CodeMeaning
400Bad Request -- Your request is invalid.
401Unauthorized -- Your API key is wrong.
404Not Found -- The specified resource could not be found.
405Method Not Allowed -- You tried to access a resource with an invalid method.
500Internal Server Error -- We had a problem with our server. Try again later.
503Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.