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:


Verb

Description

GET

retrieve a resource

POST

create a new resource

PUT

update a resource

DELETE

delete 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:

Parameter

Type

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"

       }

      

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

Parameter

Type

courseid

The identifier of the course to create or update.

string

Body/JSON Parameters

Parameter

Type

Required

fullname

The full name of the course.

string

Yes

shortname

A shortened or abbreviated name for the course

string

No

startdate

The start date & time of the course.

datetime

No

categorypath

Category node to place the course in, represented as a URI path.

string

No

templateid

The identifier of the course template or shell to use when creating the course for the first time in Moodle.

Note: When suppyling a templateid, the API queues the creation of a course as an adhoc task, instead of creating immediately, to be run with cron due to Moodle's backup and restore, which can be resource intensive, being used when creating a course from a template.

string

No


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

Parameter

Type

courseid

The identifier of the course to delete.

string


List Enrollments 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

Parameter

Type

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

Parameter

Type

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

      

Key

Value

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

Parameter

Type

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

      

Key

Value

lock

set 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

Parameter

Type

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

Parameter

Type

userid

The identifier of the user to create or update.

string

Body/JSON Parameters

Parameter

Type

Required

username

The Moodle username of the user.

string

Yes

firstname

The user's first name.

string

Yes

lastname

The user's last name.

string

Yes

email

The user's email address.

string

Yes

auth

The user's authentication method.

Default: manual

string

No

lang

The user's preferred language.

Default: site's default language

string

No

password

The user's password.

Note: May be passed as plain text or an MD5 hash

string

No

timezone

The user's timezone.

Default: site's default timezone

string

No

url

string

No

institution

string

No

department

string

No

address

string

No

city

string

No

country

string

No

icq

string

No

skype

string

No

yahoo

string

No

aim

string

No

msn

string

No

phone1

string

No

phone2

string

No

policyagreed

Default: false

boolean

No

middlename

string

No

alternatename

string

No

tenant

string


No


cohort0

cohort1

cohort2

cohort3

cohort4

cohort5

cohort6

cohort7

cohort8

cohort9

Note: The Cohort ID to add the user to.  The user can be added to up to 10 cohorts at once using 0-9.


string


No



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

Parameter

Type

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

Parameter

Type

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

      

Key

Value

plugin

Enrolment 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

Parameter

Type

userid

The identifier of the user to enrol.

string

courseid

The identifier of the course to be enroled in.

string

Body/JSON Parameters

Parameter

Type

Required

roleid

The identifier of the role to assign the user in the course.

string

No

timestart

Date & time that the user's enrolment begins.

datetime

No

timeend

Date & time that the user's enrolment ends.

datetime

No


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

Parameter

Type

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

      

Key

Value

plugin

Enrolment 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

Parameter

Type

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

Parameter

Type

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

Parameter

Type

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

Parameter

Type

Required

name

The name of the group.

string

Yes

description

A description for the group

string

No


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

Parameter

Type

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

Parameter

Type

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

Parameter

Type

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

Parameter

Type

userid

The identifier of the user to retrieve grades for.

string

Query String Parameters

Parameter

Type

Required

pagenumber

The page of results to retrieve.

Default: 1

integer

No

pagesize

The number of results per page. The maximum value allowed is 250

Default: 100

integer

No

timestart

The starting date/time to retrieve results from.

Default: 1 Year Ago

datetime

No

timeend

The ending date/time to retrieve results thru.

Default: Now

datetime

No


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

Parameter

Type

courseid

The identifier of the course to retrieve grades for.

string

Query String Parameters

Parameter

Type

Required

pagenumber

The page of results to retrieve.

Default: 1

integer

No

pagesize

The number of results per page. The maximum value allowed is 250

Default: 100

integer

No

timestart

The starting date/time to retrieve results from.

Default: 1 Year Ago

datetime

No

timeend

The ending date/time to retrieve results thru.

Default: Now

datetime

No


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

Parameter

Type

Required

pagenumber

The page of results to retrieve.

Default: 1

integer

No

pagesize

The number of results per page. The maximum value allowed is 250

Default: 100

integer

No

timestart

The starting date/time to retrieve results from.

Default: 1 Year Ago

datetime

No

timeend

The ending date/time to retrieve results thru.

Default: Now

datetime

No


Errors

The NexSIS API uses the following error codes:

Error Code

Meaning

400

Bad Request -- Your request is invalid.

401

Unauthorized -- Your API key is wrong.

404

Not Found -- The specified resource could not be found.

405

Method Not Allowed -- You tried to access a resource with an invalid method.

500

Internal Server Error -- We had a problem with our server. Try again later.

503

Service Unavailable -- We're temporrily 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.