Learning API

The Learning API is used by customers who have the Learning module in MyCompliance.

API Calls

  1. AddContentResultsPOST
    Used to allow customers to show Nano content on their own system but add completions back to MyCompliance.
  2. GetAllContentGET
    Used to get all Nano content for a customer.
  3. GetAllCoursesGET
    Used to get all courses for a customer.
  4. GetCourseResultsGET
    Used to get all results for an individual course.
  5. GetCourseAuditsGET
    Used to get all audits for an individual course.
  6. GetUserCourseResultGET
    Used to get all results for a user for an individual course. Could be used with GetAllCourses to find the correct course.
  7. GetUserResultsGET
    Used to get all course results for an individual user.

API Call Examples

AddContentResults POST
Example

$params = @'
[
{
"ContentID": "20956",
"Name": "Test Audit Video",
"Email": "testuser1@metacompliance.com",
"Timestamp": "2019-03-21T10:16:21.020",
"SaveResult": ""
}
]
'@
$url = "https://api.metacompliance.com/Learning/AddContentResults?key=7025499DFB89-
438F-8F3D-96C2EA0678G9"
$contentType = "application/json"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method POST
-Body $params

JSON returned

[
{
"Email": "testuser1@metacompliance.com",
"Name": "Test Audit Video",
"ContentID": 20956,
"Timestamp": "2019-03-21T10:16:21.02",
"SaveResult": "Data saved"
}
]
duplicate data error
[
{
"Email": "testuser1@metacompliance.com",
"Name": "Test Audit Video",
"ContentID": 20956,
"Timestamp": "2019-03-21T10:16:21.02",
"SaveResult": "Inserting a duplicate is not allowed."
}
]

GetAllContent GET
Example

$url = "https://api.metacompliance.com/Learning/GetAllContent?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9"
$contentType = "application/json"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method GET

JSON returned

[
{
"ContentID": 1588,
"Name": "DefinitionOfSmishing",
"State": "PUBLISH",
"Description": "DefinitionOfSmishing",
"Type": "Video",
"MajorVersion": 1,
"MinorVersion": 1
},
{
"ContentID": 1595,
"Name": "Trojan",
"State": "PUBLISH",
"Description": "Trojan",
"Type": "Video",
"MajorVersion": 1,
"MinorVersion": 0
},
{
"ContentID": 1596,
"Name": "What is Spear Phishing",
"State": "PUBLISH",
"Description": "What is Spear Phishing",
"Type": "Video",
"MajorVersion": 1,
"MinorVersion": 0
}
]

GetAllCourses GET
Example

$url = "https://api.metacompliance.com/Learning/GetAllCourses?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9"
$contentType = "application/json"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method GET

JSON returned

[
{
"CourseID": 407,
"Name": "What is GDPR",
"MajorVersion": 1,
"MinorVersion": 0,
"CourseType": "TINCAN"
},
{
"CourseID": 413,
"Name": "A Phishermans Tale",
"MajorVersion": 1,
"MinorVersion": 0,
"CourseType": "FUSION"
},
{
"CourseID": 416,
"Name": "Personal Data Inventory",
"MajorVersion": 1,
"MinorVersion": 0,
"CourseType": "SCORM"
}
]

GetCourseResults GET
Example

$url = "https://api.metacompliance.com/Learning/GetCourseResults?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9&courseName=Test Fusion Course&courseID=4141"
$contentType = "application/json"

Optional query parameter – customerTimeStamp

$url = "https://api.metacompliance.com/Learning/GetCourseResults?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9&courseName=Test Fusion Course&courseID=4141
&customerTimeStamp=2020-05-29 10:32:00"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method GET

JSON returned

{
"CourseID": 4141,
"Name": "Test Fusion Course",
"MajorVersion": 1,
"MinorVersion": 0,
"CourseType": "FUSION",
"UserResults": [
{
"Email": "testuser7@metacompliance.com",
"UserID": 450553,
"CourseID": 4141,
"ContentID": 21445,
"Timestamp": "2019-06-26T10:37:25.723",
"PercentageCompleted": 100
}
],
"QuizResults": [
{
"QuizID": 9951,
"QuizScore": 100,
"Attempts": 1,
"CompletionStatus": "Completed",
"Timestamp": "2019-06-26T10:37:50.56"
}
]
}

GetCourseAudits GET
Example

$url = "https://api.metacompliance.com/Learning/GetCourseAudits?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9 &courseName=Course01&courseID=71458"
$contentType = "application/json"

Optional query parameter – customerTimeStamp

$url = "https://api.metacompliance.com/Learning/GetCourseAudits?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9 &courseName=Course01&courseID=71458
&customerTimeStamp=2020-05-29 10:32:00"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method GET

JSON returned

[
{
"CourseName": "Course01",
"Status": "-",
"Points": "0",
"PercentageComplete": "0",
"CourseType": "Media",
"MetaEngage": "False",
"ManageInCampaign": null,
"RecurringAnnually": "False",
"DirectAccess": null,
"Mandatory": null,
"CampaignName": "Campaign01",
"Actions": "",
"UserID": "2424534",
"CourseID": "75858",
"CourseCompleted": "-",
"SendCount": "1",
"State": "PUBLISH",
"SCIMPostcode": "-",
"SuccessStatus": "-",
"TimeSpent": "-",

"Name": "Test User 1",
"Email": "testuser1@metacompliance.com",
"Department": "Development",
"Version": "1.0",
"Timestamp": "-",
"UserStatus": "Active",
"CollectiveName": "-",
"SubGroup": "-",
"UserType": "AD",
"OU": "Development",
"Domain": "metacompliance",
"SCIMDepartment": "-",
"SCIMStreetAddress": "-",
"SCIMRegion": "-",
"SCIMCountry": "-",
"SCIMLocality": "-",
"SCIMGroup": "-",
"EnrollmentDate": "2021-10-13",
"Supervisor": "-",
"SupervisorsManager": "-",
"CF1": "-",
"CF2": "-",
"CF3": "-",
"CF4": "-",
"CF5": "-",
"AnonResponse": null
}
]

GetUserCourseResult GET
Example

$url = "https://api.metacompliance.com/Learning/GetUserCourseResult?key=7025499DFB89-
438F-8F3D-96C2EA0678G9&email=testuser5@metacompliance.com&courseID=4216"
$contentType = "application/json"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method GET

JSON returned

{
"Email": "testuser5@metacompliance.com",
"UserID": 450548,
"CourseID": 4216,
"AuditStatus": "Completed",
"Timestamp": "2019-07-15T14:42:07.34",
"QuizResults": []
}

GetUserResults GET
Example

$url = "https://api.metacompliance.com/Learning/GetUserResults?key=7025499D-FB89-
438F-8F3D-96C2EA0678G9&email=testuser6@metacompliance.com&course=true"
$contentType = "application/json"

Invoke-RestMethod $url -Headers $headers -ContentType $contentType -Method GET

JSON returned

[
{
"Email": "testuser6@metacompliance.com",
"UserID": 450549,
"Name": "Test Course1",
"ContentID": 14243,
"Timestamp": "2019-04-09T16:23:43.257",
"PercentageCompleted": 0
},
{
"Email": "testuser6@metacompliance.com",
"UserID": 450549,
"Name": "Test Course2",
"ContentID": 1743,
"Timestamp": "2019-04-11T09:46:03.693",
"PercentageCompleted": 0
},
{
"Email": "testuser6@metacompliance.com",
"UserID": 450549,
"Name": "Test Course3",
"CourseID": 1072,
"ContentID": 1588,
"Timestamp": "2019-04-11T09:46:46.867",
"PercentageCompleted": 100
}
]
Back to all articles