Traverse API documentation

API endpoints

API authentication

You can find your API key in the account settings dialog. It needs to be set in the api-key header for every request.
 
notion image

Get student info for a course

GET https://traverse.link/api/student_info/?course=COURSETITLE&creator=USERNAME
Example in JavaScript:
fetch(
  `https://traverse.link/api/student_info/?course=${courseTitle}&creator=${myUsername}`,
  {
    method: "GET",
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json",
      "api-key": apiKey
    }
  }
)
Returns student data (email addresses + enrollment status + lesson completion + flashcard reviews) for all students (if the request is made with the course creator's api key) or just for the requesting student (if the request is made with a student's api key).
Example response:
[
  {
    "email": "",
    "nrTotal": 16,
    "userName": "dominiczijlstra",
    "enrolled": false,
    "started": {
      "_seconds": 1630069489,
      "_nanoseconds": 837000000
    },
    "lessons": [
      {
        "title": "Chinese for beginners",
        "completed": {
          "_seconds": 1630069494,
          "_nanoseconds": 421000000
        },
        "started": {
          "_seconds": 1630069489,
          "_nanoseconds": 837000000
        },
        "reviews": []
      },
      {
        "title": "Characters",
        "reviews": []
      },
      {
        "title": "Er",
        "reviews": []
      },
      {
        "title": "First 5 characters",
        "reviews": []
      },
      {
        "title": "First 5 sounds",
        "started": {
          "_seconds": 1630069536,
          "_nanoseconds": 363000000
        },
        "reviews": []
      },
      {
        "title": "First story",
        "reviews": []
      },
      {
        "title": "Grammar",
        "reviews": []
      },
      {
        "title": "Pinyin",
        "completed": {
          "_seconds": 1630069498,
          "_nanoseconds": 100000000
        },
        "started": {
          "_seconds": 1630069496,
          "_nanoseconds": 64000000
        },
        "reviews": []
      },
      {
        "title": "San",
        "reviews": []
      },
      {
        "title": "Sentences",
        "reviews": []
      },
      {
        "title": "Si",
        "reviews": []
      },
      {
        "title": "Sounds",
        "completed": {
          "_seconds": 1630069495,
          "_nanoseconds": 880000000
        },
        "started": {
          "_seconds": 1630069494,
          "_nanoseconds": 506000000
        },
        "reviews": []
      },
      {
        "title": "Stories",
        "reviews": []
      },
      {
        "title": "Tones",
        "completed": {
          "_seconds": 1630069536,
          "_nanoseconds": 315000000
        },
        "started": {
          "_seconds": 1630069498,
          "_nanoseconds": 231000000
        },
        "reviews": [
          {
            "questionNr": 1,
            "score": 5,
            "reviewed": {
              "_seconds": 1630069527,
              "_nanoseconds": 945000000
            }
          },
          {
            "questionNr": 2,
            "score": 1,
            "reviewed": {
              "_seconds": 1630069536,
              "_nanoseconds": 315000000
            }
          }
        ]
      },
      {
        "title": "Words",
        "reviews": []
      },
      {
        "title": "Wu",
        "reviews": []
      },
      {
        "title": "Yi",
        "reviews": []
      }
    ]
  },
  {
    "email": "dominiczijlstra+test184@gmail.com",
    "nrTotal": 16,
    "userName": "dominiczijlstra+test184",
    "enrolled": true,
    "started": {
      "_seconds": 1630070234,
      "_nanoseconds": 136000000
    },
    "lessons": [
      {
        "title": "Chinese for beginners",
        "completed": {
          "_seconds": 1630071361,
          "_nanoseconds": 636000000
        },
        "started": {
          "_seconds": 1630070234,
          "_nanoseconds": 136000000
        },
        "reviews": []
      },
      {
        "title": "First 5 sounds",
        "started": {
          "_seconds": 1630070272,
          "_nanoseconds": 990000000
        },
        "reviews": []
      },
      {
        "title": "Pinyin",
        "completed": {
          "_seconds": 1630071364,
          "_nanoseconds": 540000000
        },
        "started": {
          "_seconds": 1630070250,
          "_nanoseconds": 282000000
        },
        "reviews": []
      },
      {
        "title": "Sounds",
        "completed": {
          "_seconds": 1630071362,
          "_nanoseconds": 994000000
        },
        "started": {
          "_seconds": 1630070248,
          "_nanoseconds": 345000000
        },
        "reviews": []
      },
      {
        "title": "Tones",
        "completed": {
          "_seconds": 1630070272,
          "_nanoseconds": 955000000
        },
        "started": {
          "_seconds": 1630070252,
          "_nanoseconds": 239000000
        },
        "reviews": [
          {
            "questionNr": 1,
            "score": 4,
            "reviewed": {
              "_seconds": 1630070266,
              "_nanoseconds": 967000000
            }
          },
          {
            "questionNr": 2,
            "score": 1,
            "reviewed": {
              "_seconds": 1630070272,
              "_nanoseconds": 953000000
            }
          },
          {
            "questionNr": 2,
            "score": 3,
            "reviewed": {
              "_seconds": 1630070273,
              "_nanoseconds": 953000000
            }
          }
        ]
      }
    ]
  }
]

Add students to a course

POST https://traverse.link/api/add_students
Request body:
{
	emails: [ARRAY_OF_EMAILS],
	courses: [ARRAY_OF_COURSE_URLS] // a course URL looks like "/CREATORUSERNAME/COURSETITLE"
}
Example in JavaScript:
fetch(`https://traverse.link/api/add_students`, {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
    "api-key": apiKey
  },
  body: JSON.stringify({
    emails: ["dominiczijlstra+test170@gmail.com"],
    courses: ["/dominiczijlstra/Chinese%20for%20beginners"]
  })
})
Example in Zapier:
To use this as your Zapier action, choose Webhooks by Zapier and then Custom request. Then configure the fields as below:
notion image
Give all email addresses access to the courses specified. If the student already has a Travrerse.link account, they will be enrolled automatically. If they don't have an account yet, they will be enrolled as soon as they sign up. No emails are sent to the students, you need to notify them yourself!
N.B. a course URL looks like /CREATORUSERNAME/COURSETITLE and should be URL encoded, for example "/dominiczijlstra/Chinese%20for%20beginners"
 
Example response:
{"emails":["dominiczijlstra+test170@gmail.com"],"courses":["/dominiczijlstra/Chinese%20for%20beginners"],"added":true}
 

Remove a student from a course

POST https://traverse.link/api/remove_students
Request body:
{
	emails: [ARRAY_OF_EMAILS],
	courses: [ARRAY_OF_COURSE_URLS] // a course URL looks like "/CREATORUSERNAME/COURSETITLE"
}
Example in JavaScript:
fetch(`https://traverse.link/api/remove_students`, {
  method: "POST",
  headers: {
    Accept: "application/json",
    "Content-Type": "application/json",
    "api-key": apiKey
  },
  body: JSON.stringify({
    emails: ["dominiczijlstra+test170@gmail.com"],
    courses: ["/dominiczijlstra/Chinese%20for%20beginners"]
  })
})
Revoke access to the courses specified for all email addresses specified.
N.B. a course URL looks like /CREATORUSERNAME/COURSETITLE and should be URL encoded, for example "/dominiczijlstra/Chinese%20for%20beginners"
 
Example response:
{"emails":["dominiczijlstra+test170@gmail.com"],"courses":["/dominiczijlstra/Chinese%20for%20beginners"],"removed":true}
 
 

Webhooks

You can specify URL's that will be notified when certain events happen in your account settings. A POST request with the relevant data will be sent here when an event happens.
notion image

Student enrollment

Get notified when a student enrolls in one of your courses. The response will specify which course, whether or not the student paid, and the student email.
Example response:
{
	"type": "student_enrolled",
	"paid": false,
	"course": "test",
	"creator": "dominiczijlstra",
	"studentUsername": "hi",
	"studentEmail": "dominiczijlstra+test@gmail.com"
}
 
Example to use as Zapier trigger
Use a catch hook
notion image
And copy the resulting URL to your endpoints
notion image

Sign up for our free email course and newsletter

Get high value superlearning tips, and stay up to date with our latest articles, podcasts and course offerings

Get Free Newsletter