Skip to content

API

A REST API for JomBeelajar is on the roadmap.

Placeholder: the API is not public yet. The endpoints marked live exist because the web app uses them, but they only accept a signed-in session, are not documented as stable, and may change without notice. API keys do not exist yet.

Authenticating (planned)

Once API keys ship, requests will send the key as a bearer token.

curl -H "Authorization: Bearer jb_..." https://jombeelajar.taufikhamid.com/api/v1/subjects

Subjects and topics

  • GET/api/subjectsLive

    List subjects.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/subjects/{slug}Live

    Get one subject.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/subjects/{slug}/chaptersLive

    List a subject's chapters.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/subjects/{slug}/chapters-with-topicsLive

    List a subject's chapters with their topics.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/topics/{topicId}Live

    Get one topic.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/topics/randomLive

    Get a random topic.

    Auth: signed-in session cookie only

    Response: application/json

Quizzes

  • GET/api/quizzes-listLive

    List quizzes. Optional ?topicId filters by topic.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/quizzes/randomLive

    Get a random quiz.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/quiz/{quizId}Live

    Get a quiz.

    Auth: signed-in session cookie only

    Response: application/json

  • POST/api/quiz/{quizId}/submitLive

    Submit answers for a quiz attempt.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/quiz/{quizId}/commentsLive

    List comments on a quiz.

    Auth: signed-in session cookie only

    Response: application/json

  • POST/api/quiz/{quizId}/commentsLive

    Comment on a quiz.

    Auth: signed-in session cookie only

    Response: application/json

Leaderboard and schools

  • GET/api/leaderboardLive

    Student leaderboard. ?timeFrame=daily|weekly|allTime.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/leaderboard/schoolsLive

    School leaderboard.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/schoolsLive

    List schools.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/schools/{id}Live

    Get one school.

    Auth: signed-in session cookie only

    Response: application/json

Profile and progress

  • GET/api/profile/{userId}Live

    Get a user's public profile.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/profile/{userId}/achievementsLive

    List a user's achievements.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/dashboardLive

    Dashboard data for the signed-in user.

    Auth: signed-in session cookie only

    Response: application/json

  • GET/api/me/progressLive

    The signed-in user's learning progress.

    Auth: signed-in session cookie only

    Response: application/json

  • PATCH/api/meLive

    Update the signed-in user's profile.

    Auth: signed-in session cookie only

    Response: application/json

Planned

  • GET/api/v1/subjectsPlanned

    Versioned, API-key-authenticated list of subjects.

  • GET/api/v1/quizzesPlanned

    Versioned, API-key-authenticated list of quizzes.

  • GET/api/v1/me/progressPlanned

    Your progress, readable with an API key.

  • GET/api/keysPlanned

    List your API keys (without their secret values).

  • POST/api/keysPlanned

    Create a new API key.

  • DELETE/api/keys/{id}Planned

    Revoke an API key.