Powershell Script to convert JSON data from API to CSV (Carers)

Job ID: 35768825

Budget: $30 – $250 AUD

Provisining-GetParents.ps
Project summary
Develop a Powershell script that can connect to an enterprise application using a rest API. The script will manipulate the data and export a series of CSV files.
API documentation
https://integrations.edumate.net/apidoc/
The API calls required for this script are:
• Authorisation
• Get contacts
API Endpoints
The script will need extract data from multiple systems (later referred to as colleges) using differing client secret details. The script will need to reference a college definition file that has this information.
Each college also has the following attributes:
• $CollegeLong
• $CollegeShort
Ideally, the database connection functionality should be contained in a separate script so that it can be called by other future scripts.
Data required
It should be noted that ‘Get-Contacts’ only returns 100 records at a time so the pagination will need to be recursed through.
The script shall extract the the following records:
• scope = Current & Future
• contactType = carer
The records shall be populated into a CSV with the following field mapping:
• first_name  firstname
• last_name  surname
• email  email_address
• recovery_phone  mobile_phone
• recovery_email  email_address
• sis_id  username
• role  “Parent”
• password  first and last initial + birthdate reformatted as DDMMYY eg cw150389
• user_name  username
• college  $CollegeLong
• launch_url  https://$CollegeShort.domain.app
• app_url  ""
How will the script be executed?
The script will be executed by cron on a unix machine.
Output
The script shall output the following:
1. A CSV file containing the data for each college “parents\$College_short.csv”
2. A CSV file containing all the data combined “parents\consolidated.csv”
3. A log file indicating the number of records extracted or the error
Other Notes
1. Script should be well documented/commented with all inputs defined as variables.
Related categories: Script Install Shell Script JSON Powershell