School-links and Beep4Business supports CSV uploads for general users (e.g. admins, associates, contacts) via HTTPS API.


You'll need a system that has an integration with SL/B4B, or you'll need to write your own upload integration.


To get credentials (username and password) to use this API, you'll need to submit a ticket to our helpdesk.


API

Endpoint URL (HTTPS only):

https://api.school-links.org.nz/data/uploadCsv

Please note this url is case sensitive


Request Details

Method: POST

Authorisation: HTTPS Basic Authorization

Request Body: form-data

Parameters:

  • file (required) - the CSV file to be uploaded in the format specified below. Maximum 5MB
    • This must be passed in the form-data format in the request body


Example Request

curl -X POST https://api.school-links.org.nz/data/uploadCsv \
  -H "Authorization: Basic dG9wOnNlY3JldA==" \
  -H "Content-Type: multipart/form-data" \
  -H "file=@/path/to/file.csv"

Response Details

Success Response

Status code: 201

Content:

{
    "data": {
    	"filename": "2023-02-08-14-05-25-api-example-primary.csv",
        "cleanupFromPrevious": false
    }
}

Authentication Error

Status code: 401

Content:

{
    "errors": [
        {
            "status": 401,
            "title": "Authentication Error",
            "detail": "Requires authentication (empty or incorrect username/password)"
        }
    ]
}

Authorisation Error

Status code: 403

Content:

{
    "errors": [
    	{
        	"status": 401,
            "title": "Authorisation Error",
            "detail": "Unauthorised (organisation may not be enabled for API access)"
        }
    ]
}

Request Error

Status code: 400

Content:

{
    "errors": [
        {
            "status": 401,
            "title": "Invalid Payload",
            "detail": "Missing or invalid file"
        }
    ]
}


CSV Format

CSVs must be formatted according to RFC 4180 (e.g. enclosing fields containing commas in double quotation marks ""S) and use UTF-8 (without BOM) or ASCII encoding. Note that some fields in SL/B4B support only ASCII characters.


Example CSV files


Format Details

  • Encodings supported: UTF-8 (without BOM) or ASCII
  • The first row of the file must contain a header row that defines column names/types
  • For each column, the header row value should be a string consisting of one of the supported column names listed in the leftmost column of the table below
  • Column names must be unique within a file (e.g. if "email" appears in the header row more than once, we will import only one of these two columns)
  • Subsequent rows must contain data that is compatible with the column definitions in the header row (e.g. "email" column data must contain valid email addresses


Available header row column names, the data fields they map to in School-links / Beep4Business, and the data type requirements are listed in the table below. 


Some column names have multiple aliases, such as "email" and "email address", which both map to the same data field in SL/B4B. If multiple columns in your CSV map to the same SL/B4B data field, we will use only one of the columns for importing.


Available header names and their mappings


Column name(s) in CSV header rowData field mapped in SL/B4BDescriptionData TypeRequired?
smsidsmsidCustomer's unique identifier for this personASCII string up to 128 characters long
Must be unique across all person records at your organisation
No
type(role type)SL/B4B role type of person in this record (e.g. "staff" or "associate")One of the following strings:
  • student
  • caregiver
  • teacher
  • staff
  • associate
  • contact
Yes
first name
first
first namePerson's first nameUTF-8 string (<= 64 characters)Yes
(or full name)
last name
last
last namePerson's last nameUTF-8 string (<= 64 characters)Yes
(or full name)
full namefull namePerson's full name (as an alternate to first + last)UTF-8 string (<= 384 characters)No
(unless no first + last)
middle namesmiddle namesPerson's middle name(s)UTF-8 string (<= 256 characters)No
titletitlePerson's titleUTF-8 string (<= 8 characters)No
gendergenderPerson's genderGender string ("f" / "m" / "male" / "female")No
dob.yyyymmdddate of birthPerson's date of birthDate string in YYYY-MM-DD format e.g. "2023-12-25"No
dob.ddmmyyyydate of birthPerson's date of birthDate string in DD-MM-YYYY format e.g. "25-12-2023"No
email
email address
email_address
emailPerson's email addressValid email address stringNo
mobile
mobile phone
mobile_phone
cell
cellphone
mobilePerson's mobile phoneMobile phone string in either:
  1. local dialable format (e.g. 021 123 456)
  2. or E.164 international format including country code (e.g. +64 21 123 456)

Spaces and other characters are stripped automatically.

No
room
location
office
teacher.room
staff.room
staff.location
staff.office
Teachers / Staff only
room (School-links)
location (B4B)
Metadata field semantically intended for a human-readable locationText string (<= 256 characters)No
subject
department
division
teacher.subject
staff.department
staff.division
staff.subject
staff.role
Teachers / Staff only
subject (SL)
role (B4B)

Teacher's primary subject (SL)
Staff metadata (B4B)
Text string (<= 256 characters)No
teacher.code
teacher.staffcode
staff.code
staffcode
Teachers / Staff only
staffCode
Teacher's code e.g. MGO (SL)
Staff code or identifier (B4B)
Text string (<= 128 characters)No
association
associate.association
Associates only
association
Metadata field semantically intended to show how a person is associated with the organisationText string (<= 64 characters)No
contacttype
contact.contactType
contactgroup
Contacts only
contactType
Metadata field semantically intended to group other contacts into categoriesText string (<= 256 characters)No