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:
totalRecordCount- the total number of records in Zuniapage- the page number you've requestedlimit- the number of records per pagepageRecordCount- the number of records returned for the current pagetotalPageCount- the total number of pages available
Authentication
Authentication
- OAuth 2.0: ClientCredentials
To use the Zunia Public API, you will need an API key for your Zunia tenant:
- In Zunia, navigate to System configuration > API keys.
- Click on "Generate key".
- For API type, leave "Zunia Public API V2" selected.
- Enter a name for your key. Be descriptive!
- 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.
- Click on "Generate".
- 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: |