Skip to main content

Base URL

All GraphQL queries should be sent to the root endpoint:
POST https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql

Authentication

All requests require authentication using an API key included in the request headers: x-api-key: YOUR_API_KEY Your API key will be securely shared with you through 1Password.

Making Your First Request

Here are simple examples to get you started:

Using cURL

curl -X POST \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{"query":"{ courses(limit: 5) { identifier name } }"}' \
  https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql

Using Python

We recommend using the gql library for better GraphQL support, schema validation, and error handling:
pip install gql[requests]

import os
from gql import Client, gql
from gql.transport.requests import RequestsHTTPTransport

# Setup client
transport = RequestsHTTPTransport(
    url="https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql",
    headers={"x-api-key": os.getenv("API_KEY")},  # Your API key from 1Password
    use_json=True,
)

client = Client(transport=transport, fetch_schema_from_transport=False)

# Execute query
query = gql("""
{
  courses(limit: 5) {
    identifier
    name
    academicSubject
  }
}
""")

result = client.execute(query)
print(result)

Using JavaScript

const url = "https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql";
const apiKey = process.env.API_KEY; // Your API key from 1Password

const query = `
{
  courses(limit: 5) {
    identifier
    name
    academicSubject
  }
}
`;

fetch(url, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'x-api-key': apiKey
  },
  body: JSON.stringify({ query })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
These examples will return up to 5 courses with their identifier, name, and academic subject from the knowledge graph.