Importing data into PerfectPass requires the user to run a PowerShell script. That script zips and then uploads the data package to the PerfectPass API.
- Make sure you can run PowerShell. The minimum major version is 5. (See How do I determine the current PowerShell version)
- Download the attached UploadScript.ps1
- Edit the script
- Set your data directory path. The data directory needs to have an import file at the root named Import.csv and your photos need to be in a subdirectory named Photos in the format [ID Number].jpg
$dirToZip = "DIRECTORY PATH"
- Add your API key (See How do I find my API Key?)
$apiKey = "API KEY HERE"
- Update your import configuration (example below)
$config = "JSON CONFIGURATION"
- Set your data directory path. The data directory needs to have an import file at the root named Import.csv and your photos need to be in a subdirectory named Photos in the format [ID Number].jpg
Import configuration schema
{
"title": "ImportConfiguration",
"type": "object",
"properties": {
"scheduleType": {
"type": "string",
"enum": ["Pattern", "Block"]
},
"fieldMap": {
"type": "object",
"properties": {
"student": {
"type": "object",
"properties": {
"idNumber": { "type": "string", "description": "The student ID number column" },
"firstName": { "type": "string", "description": "The student first name column" },
"lastName": { "type": "string", "description": "The student last name column" },
...
}
},
"schedule": {
"type": "object",
"properties": {
"period": { "type": "string", "description": "The period column" },
"teacherFull": { "type": "string", "description": "The teacher full name column" },
"classId": { "type": "string", "description": "The class ID column" },
"className": { "type": "string", "description": "The class name column" },
"location": { "type": "string", "description": "The class location column" }
}
}
},
"required": ["student", "schedule"]
}
},
"required": ["scheduleType", "fieldMap"]
}Import configuration example
$config = "{" +
"scheduleType: 'Pattern', " +
"fieldMap: `"{ " +
"student: {" +
"idNumber: 'ID', " +
"firstName: 'FNAME', " +
"lastName: 'LNAME' " +
"}," +
"schedule: {" +
"period: 'PERIOD', " +
"teacherFull: 'TEACHER', " +
"classId: 'CLSID', " +
"className: 'DESC', " +
"location: 'ROOM' " +
"}" +
"}`" " +
"}"