Repository navigation
Persona Imports
Phil edited this page Oct 3, 2026
·
4 revisions
Represents a CSV import (typically from a HR system) containing persona identifiers and their attributes.
It is accessible through the following HTTP interfaces:
-
REST HTTP Interface via
http://www.example.org/api/v2/personasimport.
To import a CSV via the API, you need to make the three requests below in order.
- Create the persona import model via the REST HTTP Interface.
- Upload the CSV via the Upload HTTP Interface.
- Process the persona import model via the Process HTTP interface.
Get all the Learning Locker® persona imports.
LearningLocker::personaImports()->get();Get a single Learning Locker® persona import with a persona import $id.
LearningLocker::personaImport($id)->get();Delete a single Learning Locker® persona import with a persona import's $id.
LearningLocker::personaImport($id)->delete();Create a single Learning Locker® persona import with an array of $data.
LearningLocker::personaImport()->create($data);Update a single Learning Locker® persona import with a persona import's $id and an array of $data.
LearningLocker::personaImport($id)->update($data);Learning Locker® Persona Imports Documentation
You can use an array when updating or creating a Learning Locker® Persona Imports
Persona Import Example
[
'organisation' => '59c1219936229d4ce9634602',
'owner' => '59c1219936229d4ce9634603',
'title' => 'Example Persona Import',
'csvHeaders' => [
0 => 'Full Name',
1 => 'Moodle User ID',
2 => 'Moodle Home Page',
3 => 'Age',
],
'structure' => [
'Full Name' => [
'columnName' => 'Full Name',
'columnType' => 'COLUMN_NAME',
'relatedColumn' => '',
'primary' => NULL,
],
'Moodle User ID' => [
'columnName' => 'Moodle User ID',
'columnType' => 'COLUMN_ACCOUNT_VALUE',
'relatedColumn' => 'Moodle Home Page',
'primary' => NULL,
],
'Moodle Home Page' => [
'columnName' => 'Moodle Home Page',
'columnType' => 'COLUMN_ACCOUNT_KEY',
'relatedColumn' => 'Moodle User ID',
'primary' => 1,
],
'Age' => [
'columnName' => 'Age',
'columnType' => 'COLUMN_ATTRIBUTE_DATA',
'relatedColumn' => '',
'primary' => NULL,
],
],
]Persona Import Model
{
"_id" : "59c1219936229d4ce9634601",
"organisation" : "59c1219936229d4ce9634602",
"owner": "59c1219936229d4ce9634603",
"title": "Example Persona Import",
"csvHeaders": ["Full Name", "Moodle User ID", "Moodle Home Page", "Age"],
"structure": {
"Full Name": {
"columnName": "Full Name",
"columnType": "COLUMN_NAME",
"relatedColumn": "",
"primary": null
},
"Moodle User ID": {
"columnName": "Moodle User ID",
"columnType": "COLUMN_ACCOUNT_VALUE",
"relatedColumn": "Moodle Home Page",
"primary": null
},
"Moodle Home Page": {
"columnName": "Moodle Home Page",
"columnType": "COLUMN_ACCOUNT_KEY",
"relatedColumn": "Moodle User ID",
"primary": 1
},
"Age": {
"columnName": "Age",
"columnType": "COLUMN_ATTRIBUTE_DATA",
"relatedColumn": "",
"primary": null
}
}
}