Skip to content

Web services

The Certifications plugin exposes a set of Moodle web services for integration with external systems. All services require the caller to be authenticated and to hold the tool/mucertify:view capability in the certification’s context.

Returns a list of certifications matching the given search parameters.

Capability: tool/mucertify:view

Parameters:

NameTypeDescription
fieldvaluesarrayList of field/value pairs to filter by. Accepted fields: id, contextid, fullname, idnumber, publicaccess, archived, tenantid.

Returns: Array of certification objects with the following fields:

FieldTypeDescription
idintCertification id.
contextidintCertification context id.
fullnamestringCertification full name.
idnumberstringCertification ID number.
descriptionstringDescription text in original format.
descriptionformatintDescription text format.
publicaccessboolPublic access flag.
archivedboolArchived flag. Archived certifications should not change.
programid1intFirst (initial) program id.
programid2intRe-certification program id.
templateidintCertificate template id.
recertifyintNULL means no automatic recertification. Otherwise the number of seconds before the end of the last period when the recertification window opens.
periodsjsonstringPeriod defaults in JSON format.
timecreatedintCertification creation date.
sourcesstring[]Enabled assignment source names.
cohortidsint[]Visible cohort ids for non-public certifications.

tool_mucertify_get_certification_assignments

Section titled “tool_mucertify_get_certification_assignments”

Returns a list of assignments for a given certification, optionally filtered by user.

Capability: tool/mucertify:view

Parameters:

NameTypeDescription
certificationidintCertification id.
useridsint[]Optional list of user ids. Empty or null means all assigned users.

Returns: Array of assignment objects with the following fields:

FieldTypeDescription
idintAssignment id.
certificationidintCertification id.
useridintUser id.
sourceidintAssignment source id.
sourcetypestringInternal source type.
archivedboolArchived flag. Archived assignments should not change.
timecertifiedtempintTemporary certification valid-until date.
evidencejsonstringOther evidence for temporary certification.
timecertifiedfromintDate of first certification period start.
timecertifieduntilintDate of latest certification period end.
timecreatedintAssignment date.
deletepossibleboolWhether deletion is possible.
archivepossibleboolWhether archiving is possible.
restorepossibleboolWhether restoring is possible.

Returns the list of certification periods for a given certification and user.

Capability: tool/mucertify:view

Parameters:

NameTypeDescription
certificationidintCertification id.
useridintUser id.

Returns: Array of period objects ordered by timewindowstart, with the following fields:

FieldTypeDescription
idintPeriod id.
certificationidintCertification id.
useridintUser id.
programidintProgram id associated with this period.
timewindowstartintProgram allocation start date for this period.
timewindowdueintProgram allocation due date for this period.
timewindowendintProgram allocation end date for this period.
allocationidintProgram allocation id. NULL means not yet allocated; 0 indicates an error; value is kept after de-allocation.
timecertifiedintCertification date. Usually matches program completion, but can be overridden with admin capability.
timefromintStart date of validity. Required when timecertified is set.
timeuntilintEnd date of validity. Required when timecertified is set.
timerevokedintWhen set, the user is not considered certified even if timecertified is present. Must be set before deleting a period.
evidencejsonstringAlternative certification evidence or revoking details.
recertifiableboolWhether this period is a candidate for recertification. Expected only on the last non-revoked period.