API Reference

The Woolf API is a GraphQL-based interface that allows seamless integration with Woolf's Academic Management System (AMS). This reference guide provides detailed information on queries, mutations, schema structure, and how to interact with the API efficiently.


API Authorization

To access the API, you must authenticate using a College Token.

  • Retrieve your college token from the Configurations tab in College Settings on AMS.
    gs-api-accesstoken.gif
  • Include the token as a Bearer Token in all API requests.
    {
      "Authorization": "Bearer REPLACE_WITH_YOUR_COLLEGE_TOKEN"
    }

GraphQL Schema Overview

The Woolf API follows the GraphQL specification, which is structured into different core elements.

Element Description
Queries Used to fetch data from the API, such as retrieving student records, course details, and activities.
Mutations Used to modify data, such as adding students, updating grades, and submitting assignments.
Objects Represents structured data returned by queries and mutations 
Input Types Defines structured objects used as inputs for mutations.
Enums Defines a fixed set of values.
Scalars Built-in primitive types.

Queries

Queries in GraphQL are allows fetching and retrieving data from the Woolf API. You can use them to:

  • Retrieve structured information (e.g., get student details, fetch course lists, check resource data).
  • Filter and refine results using parameters (e.g., filter students by course, fetch active resources only).
  • Request specific fields to optimize API responses and reduce data load.

Mutations

Mutations in GraphQL are used to modify or add data in the Woolf API.

Unlike queries, which retrieve data, mutations allow you to:

  • Create new records (e.g., enroll students, add resources, submit assignments).
  • Update existing records (e.g., modify student details, change emails, update grades).
  • Perform actions (e.g., submit feedback, archive progress, generate authentication tokens).

Best Practices for Using the Woolf API

  • Use the API Sandbox for Testing: Before deploying to production, test your API queries and mutations using the API Sandbox.
  • Secure API Authentication:
    • Always include a valid Bearer Token in the Authorization header.
  • Optimize Queries for Performance:
    • Request only the fields you need to avoid unnecessary data retrieval.
    • Use pagination for queries returning large datasets.
    • Apply filters to narrow down results and reduce response times.
  • Handle API Errors Gracefully:  Check for common error codes and log errors for debugging and notify the Woolf of persistent failures.
    • 401 Unauthorized – Invalid or missing API token.
    • 403 Forbidden – Insufficient permissions.
    • 400 Bad Request – Incorrect query structure or missing fields.

FAQs


Explore More