Skip to main content
Version: 2.0.0

Zunia Public API

Zunia's APIs make it easy for schools to integrate and manage data. Third-party developers can extend and enhance Zunia's capabilities giving schools the tools they need to succeed.

Getting Started

At this stage, our official partnership program is by invite-only, but schools can create and share API keys as necessary.

In Zunia, each individual is created with a community record that they will have for life. This means that an individual can start out in pre-enrolment, progress to becoming a currently enrolled student, alumni and even a parent or staff member. Throughout all these stages, Zunia will maintain a constant community record. Central to this concept is the community ID that every student, parent, contact, staff member and business will be assigned upon their creation in Zunia.

Please note that we recommend using our current V2 endpoints where possible.

Filtering

Most GET requests allow for querying a section of a dataset. The request will only return data that matches the query condition(s).

The query parameters available for filtering are specified in the documentation for each endpoint.

Pagination

Most GET requests require pagination when fetching lists. If you don't specify the page parameter, the first page of results will be returned.

The response will include a meta object which includes the following information:

  1. totalRecordCount - the total number of records in Zunia
  2. page - the page number you've requested
  3. limit - the number of records per page
  4. pageRecordCount - the number of records returned for the current page
  5. totalPageCount - the total number of pages available

Authentication

Authentication

To use the Zunia Public API, you will need an API key for your Zunia tenant:

  1. In Zunia, navigate to System configuration > API keys.
  2. Click on "Generate key".
  3. For API type, leave "Zunia Public API V2" selected.
  4. Enter a name for your key. Be descriptive!
  5. Choose an appropriate permission group. This will allow you to control in detail what data and actions users of this key will be able to perform. As always, the recommendation is to be as conservative as possible with these permissions.
  6. Click on "Generate".
  7. Note down your client ID and secret. Note that you won't be able to retrieve your secret again, so make sure to store it securely.

All your API requests must be made using HTTPS. If you try to use HTTP, your requests will fail.

To call a Zunia Public API endpoint, you need to first obtain an access token using the client credentials flow and then use the access token to make the API request. The following example shows how to do this for the /api/v2/students/current endpoint:

# Step 1: Obtain an access token
TOKEN_URL=https://auth.zunia.com/oauth2/token
CLIENT_ID=A_CLIENT_ID
CLIENT_SECRET=A_CLIENT_SECRET

curl --request POST \
--url $TOKEN_URL \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data grant_type=client_credentials \
--data client_id=$CLIENT_ID \
--data client_secret=$CLIENT_SECRET \

# Step 2: Copy the access token from the response

# Step 3: Call the API endpoint using the access token
HOST=public-api-ap-se-2.zunia.com

curl "https://$HOST/api/v2/students/current" \
-H "Authorization: Bearer {ACCESS_TOKEN_FROM_STEP_1}"
Security Scheme Type:oauth2
OAuth Flow (clientCredentials):

Token URL: https://auth.zunia.com/oauth2/token

Scopes: