Quick Start
This guide walks you through making your first API requests to CurryCMS. By the end, you'll be able to list curricula and traverse their content structure.
Prerequisites
- A CurryCMS account with at least one curriculum
- An API token (create one here)
Step 1: Verify Your Token
Test that your token works by fetching your user info:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-domain.com/api/v1/me
You should see a response like:
{
"status": "ok",
"data": {
"id": "usr_abc123",
"type": "user",
"attributes": {
"email": "you@example.com",
"name": "Your Name"
}
}
}
Step 2: List Your Curricula
Fetch all curricula available to your organization:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-domain.com/api/v1/curricula
Response:
{
"status": "ok",
"data": [
{
"id": "cur_xyz789",
"type": "curriculum",
"attributes": {
"title": "Grade 3 Mathematics",
"description": "Complete math curriculum for third grade",
"status": "published"
}
}
],
"meta": {
"total_count": 1
}
}
Step 3: Get a Curriculum with Root Nodes
Fetch a specific curriculum to see its top-level structure:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-domain.com/api/v1/curricula/cur_xyz789
The response includes the curriculum details and its root content nodes (e.g., Units or Modules).
Step 4: Traverse Content Nodes
Each content node can have children. Use the content nodes endpoint to traverse the tree:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-domain.com/api/v1/content_nodes/nod_abc123
Response:
{
"status": "ok",
"data": {
"id": "nod_abc123",
"type": "content_node",
"attributes": {
"title": "Unit 1: Addition and Subtraction",
"node_type": {
"name": "Unit",
"icon": "folder"
},
"position": 1,
"depth": 1,
"has_children": true,
"attributes": {
"learning_objectives": ["Understand place value", "Add two-digit numbers"]
}
},
"relationships": {
"children": {
"data": [
{
"id": "nod_def456",
"type": "content_node",
"attributes": {
"title": "Lesson 1: Place Value Review",
"has_children": true
}
}
]
}
}
},
"meta": {
"children_count": 5
}
}
Notice the has_children flag—use it to know when to fetch deeper levels.
Step 5: Get Resolved Content
For nodes that inherit content from parent curricula or have variant overrides, use the resolved endpoint:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://your-domain.com/api/v1/content_nodes/nod_abc123/resolved
This returns the fully merged content with all inheritance and variants applied.
Complete Example
Here's a complete JavaScript example that loads a curriculum tree:
const API_BASE = 'https://your-domain.com/api/v1';
const TOKEN = 'YOUR_TOKEN';
async function api(endpoint) {
const response = await fetch(`${API_BASE}${endpoint}`, {
headers: {
'Authorization': `Bearer ${TOKEN}`,
'Content-Type': 'application/json'
}
});
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
return response.json();
}
async function loadCurriculumTree(curriculumId) {
// Get curriculum with root nodes
const { data: curriculum } = await api(`/curricula/${curriculumId}`);
console.log(`Loaded: ${curriculum.attributes.title}`);
// Get root nodes
const rootNodes = curriculum.relationships?.root_nodes?.data || [];
for (const node of rootNodes) {
await loadNodeRecursively(node.id, 0);
}
}
async function loadNodeRecursively(nodeId, depth) {
const { data: node } = await api(`/content_nodes/${nodeId}`);
const indent = ' '.repeat(depth);
console.log(`${indent}- ${node.attributes.title}`);
if (node.attributes.has_children) {
const children = node.relationships?.children?.data || [];
for (const child of children) {
await loadNodeRecursively(child.id, depth + 1);
}
}
}
// Run it
loadCurriculumTree('cur_xyz789');
Next Steps
- Read the full API Reference for all endpoints
- Learn about Authentication best practices
- Explore the interactive API Explorer