Zunia Public API

website·Indexed 31 days ago

https://developers.zunia.com

API documentation for Zunia, featuring endpoints for school configuration, student management (including contact updates, photo permissions, and medical conditions), and a comprehensive set of lookup services for nationalities, visas, qualifications, and transport.

Tokens
57.7K
Snippets
216
Records
388
Agent score
49%

What's inside Zunia

  1. Overview of Zunia OneRoster API

    The Zunia OneRoster API is based on the OneRoster 1.1 specification, enabling the secure exchange of roster information, course materials, and grades between Zunia and other systems (such as Google Classroom and Microsoft Teams for Education). It is available for third-party developers to extend Zunia's capabilities.
  2. Understand Zunia Community IDs

    Zunia uses a 'community' record system where every individual (student, parent, contact, staff member, or business) is assigned a unique, lifelong community ID upon creation. This ID remains constant as the individual progresses through different roles (e.g., from pre-enrolment to student to alumni).
  3. Request an OAuth 2.0 Access Token for OneRoster API

    Zunia OneRoster API uses OAuth 2.0 Bearer Token Authorization. To obtain an access token, send a POST request to the /api/token endpoint using Basic Authentication (Base64 encoded Client ID and Secret) and specify the required OneRoster scopes in the request body.
    HOST=public-api-ap-se-2.zunia.com
    CLIENT_ID=<CLIENT_ID>
    CLIENT_SECRET=<CLIENT_SECRET>
    BASIC_AUTH_CREDENTIALS=$(echo -n "$CLIENT_ID:$CLIENT_SECRET" | base64)
    
    curl --location "https://$HOST/api/token" \
      --header "Content-Type: application/x-www-form-urlencoded" \
      --header "Authorization: Basic $BASIC_AUTH_CREDENTIALS" \
      --data-urlencode "grant_type=client_credentials" \
      --data-urlencode "scope=https://purl.imsglobal.org/spec/or/v1p1/scope/roster-core.readonly https://purl.imsglobal.org/spec/or/v1p1/scope/roster-demographics.readonly https://purl.imsglobal.org/spec/or/v1p1/scope/resource.readonly https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.readonly https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.createput https://purl.imsglobal.org/spec/or/v1p1/scope/gradebook.delete"
  4. Fetch lookup values for other requirements

    Use the GET /lookup/other-requirement endpoint to retrieve a list of lookup values. The response returns a data object containing the name, display name, and a list of available options. Each option includes a unique identifier, description, code, sort order, active status, value, and title.
    // Expected Response Schema (200 OK)
    {
      "code": "string",
      "data": {
        "name": "string",
        "displayName": "string",
        "options": [
          {
            "id": "uuid",
            "description": "string",
            "code": "string",
            "sortOrder": 0,
            "active": true,
            "value": "string",
            "title": "string"
          }
        ]
      }
    }
  5. Authenticate with Zunia OneRoster API using OAuth2

    The Zunia OneRoster API uses the OAuth2 clientCredentials flow for authentication. To obtain an access token, send a request to the token endpoint. Once obtained, the token must be included in the header of subsequent API requests as a Bearer token: Authorization: Bearer $ACCESS_TOKEN.
    # Example header for API requests
    Authorization: Bearer YOUR_ACCESS_TOKEN
  6. Fetch physical requirement lookup values

    Use the GET /lookup/physical-requirement endpoint to retrieve a list of lookup values associated with physical requirements. The response returns a data object containing the requirement name, display name, and a list of available options.
    GET /lookup/physical-requirement
  7. Understand the Physical Requirement lookup response schema

    The /lookup/physical-requirement endpoint returns a JSON response with the following structure:

    • code (string, required): The status or identification code.
    • data (object): Contains the requirement details:
      • name (string, required): The internal name of the requirement.
      • displayName (string, required): The human-readable name.
      • options (array, required): A list of available options, where each option contains:
        • id (uuid, required): Unique identifier for the option.
        • description (string, required): Detailed description of the option.
        • code (string, required): The option code.
        • sortOrder (number, required): The display order of the option.
        • active (boolean, required): Whether the option is currently active.
        • value (string, required): The value of the option.
        • title (string, required): The display title of the option.
  8. Authenticate with Zunia Public API using OAuth 2.0

    Zunia Public API uses OAuth 2.0 Client Credentials flow for authentication. All requests must be made over HTTPS. To authenticate, you must first generate a Client ID and Secret in the Zunia system (System configuration > API keys), then exchange these credentials for an access token via the token endpoint.
    # Step 1: Obtain an access token
    TOKEN_URL=https://auth.zunia.com/oauth2/token
    CLIENT_ID=YOUR_CLIENT_ID
    CLIENT_SECRET=YOUR_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: Use the access token to call an API endpoint
    HOST=public-api-ap-se-2.zunia.com
    
    curl "https://$HOST/api/v2/students/current" \
      -H "Authorization: Bearer {ACCESS_TOKEN_FROM_STEP_1}"
  9. Make authenticated requests to the OneRoster API

    Once an access token is obtained, include it in the Authorization header as a Bearer token for all subsequent API requests.
    HOST=public-api-ap-se-2.zunia.com
    ACCESS_TOKEN=<ACCESS_TOKEN>
    
    curl --location "https://$HOST/ims/oneroster/v1p1/students" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer $ACCESS_TOKEN"
  10. Understand the Dietary Requirement lookup response schema

    The /lookup/dietary-requirement endpoint returns a JSON response with the following structure:

    • code (string, required): The status or category code.
    • data (object): Contains the lookup details:
      • name (string, required): The internal name of the lookup.
      • displayName (string, required): The human-readable name of the lookup.
      • options (array, required): A list of dietary requirement options, where each option contains:
        • id (uuid, required): Unique identifier for the option.
        • description (string, required): Detailed description of the requirement.
        • code (string, required): The technical code for the requirement.
        • sortOrder (number, required): The sequence order for displaying the option.
        • active (boolean, required): Indicates if the option is currently active.
        • value (string, required): The value associated with the requirement.
        • title (string, required): The display title of the requirement.
  11. Fetch dietary requirement lookup values

    Use the GET /lookup/dietary-requirement endpoint to retrieve a list of available dietary requirement lookup values. The response returns a data object containing a list of options, each including a unique identifier, a code, and a display title.
    GET /lookup/dietary-requirement