API: cursussen
Cursussen opvragen, aanmaken, bijwerken en verwijderen, en het cursuscijfer van een cursist zetten.
De groep Courses gaat over de cursus zelf. Je kunt alle cursussen opvragen met hun aantallen registraties, een cursus aanmaken, de naam wijzigen, de cursus verwijderen of handmatig een cursuscijfer zetten voor één cursist. Leerobjecten en LTI-tools in een cursus hebben hun eigen groepen: API: learning objects en API: LTI-tools.
Elk endpoint accepteert zowel GET als POST; de kop toont de methode die de specificatie als eerste noemt. Uploads gaan alleen met POST. Stuur je API-sleutel mee in de header Access-Token. De basis-URL is https://<your-platform>/local/ltisaas/api.php/v1; met v0 en het token dummy krijg je testdata. Foutmeldingen komen terug als JSON met success: false, error en debuginfo. Authenticatie, versies en limieten staan in API-documentatie. De beschrijvingen van endpoints en velden hieronder komen uit de specificatie en zijn Engels.
Gegenereerd uit de LtiSaas API-specificatie 1.0, opgehaald op 2026-10-30 van dev-auto.
| Endpoint | Beschrijving |
|---|---|
| GET /course/list | Retrieve all courses |
| GET /course/add | Create a new course |
| GET /course/update | Update an existing course |
| GET /course/delete | Delete an existing course by its ID |
| POST /course/grade | Set or reset a user’s course grade |
GET /course/list
Retrieve all courses. Fetches a list of courses along with associated LTI information.
Parameters
Dit endpoint heeft geen parameters.
Voorbeeldverzoek
curl -H "Access-Token: <your token>" \
"https://<your-platform>/local/ltisaas/api.php/v1/course/list"Voorbeeldantwoord (200). Successful retrieval of course list.
{
"success": true,
"results": [
{
"courseid": 2,
"categoryid": 4,
"categoryname": "Cybersecurity",
"coursename": "Moodle training for dummies",
"coursenameshort": "MLD01",
"description": "Introduction to Moodle.",
"imageurl": "https://<your-platform>/local/linqur_courseimages/public.php?courseid=123",
"totalregistrations": 506,
"ltiregistrations": 300,
"magicregistrations": 180,
"proxyregistrations": 26,
"totalltitools": 3,
"toolids": [
3,
5,
6
]
}
]
}Fouten: 400 Bad Request, 401 Unauthorized
GET /course/add
Create a new course. This endpoint allows you to create a new course. The course name should be passed as a query parameter.
Parameters
| Naam | In | Type | Verplicht | Beschrijving |
|---|---|---|---|---|
coursename | query | string | ja | The name of the course to be created. |
coursenameshort | query | string | nee | The shortname of the course to be created. |
Voorbeeldverzoek
curl -H "Access-Token: <your token>" \
"https://<your-platform>/local/ltisaas/api.php/v1/course/add?coursename=<coursename>"Voorbeeldantwoord (200). Course created successfully.
{
"success": true,
"courseid": 131
}Fouten: 400 Bad Request, 401 Unauthorized
GET /course/update
Update an existing course. This endpoint allows you to update an existing course. The course id should be passed as a query parameter.
Parameters
| Naam | In | Type | Verplicht | Beschrijving |
|---|---|---|---|---|
coursename | query | string | ja | The name of the course to be created. |
coursenameshort | query | string | nee | The name of the course to be created. |
courseid | query | integer | ja | The unique identifier of the course to be deleted. |
Voorbeeldverzoek
curl -H "Access-Token: <your token>" \
"https://<your-platform>/local/ltisaas/api.php/v1/course/update?coursename=<coursename>&courseid=<courseid>"Voorbeeldantwoord (200). Course created successfully.
{
"success": true
}Fouten: 400 Bad Request, 401 Unauthorized
GET /course/delete
Delete an existing course by its ID. This endpoint allows you to delete an existing course by providing its unique identifier (course ID).
Parameters
| Naam | In | Type | Verplicht | Beschrijving |
|---|---|---|---|---|
courseid | query | integer | ja | The unique identifier of the course to be deleted. |
Voorbeeldverzoek
curl -H "Access-Token: <your token>" \
"https://<your-platform>/local/ltisaas/api.php/v1/course/delete?courseid=<courseid>"Voorbeeldantwoord (200). Successful operation.
{
"success": true
}Fouten: 400 Bad Request, 401 Unauthorized
POST /course/grade
Set or reset a user’s course grade. Set or reset a user’s course grade. Grade between 0 and 100, interpreted as a manual entry in the Moodle gradebook. If reset=1, removes the override and restores the original calculated grade.
Request body (multipart/form-data). Grade setting parameters.
| Veld | Type | Verplicht | Beschrijving |
|---|---|---|---|
userid | integer | ja | Moodle user ID of the student. Voorbeeld: 123. |
courseid | integer | ja | Identifier of the course. Voorbeeld: 456. |
grade | number | ja | Grade. Voorbeeld: 1.1. Minimaal 0. |
reset | integer | nee | If 1, resets the course grade to its original calculated value (removes override). Toegestane waarden: 0, 1. Voorbeeld: 0. |
Voorbeeldverzoek
curl -X POST -H "Access-Token: <your token>" \
-F "userid=123" \
-F "courseid=456" \
-F "grade=1.1" \
"https://<your-platform>/local/ltisaas/api.php/v1/course/grade"Voorbeeldantwoord (200). Grade set successfully.
{
"success": true,
"message": "Grade set successfully",
"finalgrade": 85
}Fouten: 400 Bad request - validation error or user not enrolled, 401 Unauthorized access