Vocabulary Builder(EOL soon)
Vocabulary Builder(EOL soon) · GPT-Aktionen
Language Learning and Vocabulary API
This API allows interaction with a vocabulary database to manage word entries as part of a language learning process.
GET /api/token/{real_token}Checks the validity of a user's tokenGET /api/token/{real_token}/vocabulary/{vocabulary_name}Retrieves a list of words from the specified vocabulary for a valid tokenPOST /api/token/{token}/vocabulary/{vocabulary}/wordsAdds a new word along with a summary of the interaction to the specified vocabularyPOST /api/tokenGenerates a new access tokenGET /api/token/{real_token}/vocabularyRetrieves all vocabulary associated with the specified tokenPUT /api/token/{token}/vocabulary/{old_vocabulary}/rename/{new_vocabulary}Renames a specified vocabulary for a given tokenPOST /api/token/{token}/preferencesUpdates preferences for a specified tokenGET /api/token/{token}/word/{word}/existsChecks if a word exists in the user's vocabularyPOST /api/token/{token}/batch-add-wordsBatch add words to the specified token's vocabularyGET /api/topicsRetrieves all topics for a specified level and modePOST /api/feedback/{token}Collects user feedbackGET /api/prompts/{mode}Retrieves a list of prompts based on the specified modeGET /api/token/{token}/reviewGet words for review based on spaced repetition algorithmPOST /api/token/{token}/reviewUpdate review feedback for a wordPUT /api/token/{token}/vocabulary/{vocabulary}/words/masterMark a word as masteredPOST /api/trackCreate a new user action trackGET /api/track/{token}Get all tracks for a specific tokenGET /api/next-topic/{level}/{token}Retrieves the next topic for a user based on their level and progressPOST /api/comprehensive/progressStores the current topic order for a user's comprehensive learning progressPOST /api/noteUploads a note for the userGET /api/notesRetrieves notes for the userPOST /api/token/{token}/words/checkCheck multiple words for existence
Ursprüngliches API-Schema
{
"openapi": "3.1.0",
"info": {
"title": "Language Learning and Vocabulary API",
"description": "This API allows interaction with a vocabulary database to manage word entries as part of a language learning process.",
"version": "1.0.0"
},
"servers": [
{
"url": "https://www.vocabank.org",
"description": "Development server",
"insecure": true
}
],
"paths": {
"/api/token/{real_token}": {
"get": {
"operationId": "checkToken",
"summary": "Checks the validity of a user's token",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "real_token",
"in": "path",
"required": true,
"description": "The user's token to check",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Token is valid",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"value": {
"type": "string"
},
"expiry": {
"type": "string",
"format": "date-time"
},
"preferences": {
"type": "object",
"additionalProperties": true
}
}
}
}
}
},
"404": {
"description": "Token not found or has expired",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{real_token}/vocabulary/{vocabulary_name}": {
"get": {
"operationId": "getVocabulary",
"summary": "Retrieves a list of words from the specified vocabulary for a valid token",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "real_token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "vocabulary_name",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of vocabulary items",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"word": {
"type": "string"
},
"summary": {
"type": "string"
},
"date_added": {
"type": "string",
"format": "date-time"
},
"review_times": {
"type": "array",
"items": {
"type": "string",
"format": "date-time"
}
},
"note": {
"type": "string"
}
}
}
}
}
}
},
"404": {
"description": "Token or vocabulary not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/vocabulary/{vocabulary}/words": {
"post": {
"operationId": "addWord",
"summary": "Adds a new word along with a summary of the interaction to the specified vocabulary",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "vocabulary",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/WordEntry"
}
}
}
},
"responses": {
"200": {
"description": "Word and summary added to the vocabulary",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"id": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token": {
"post": {
"operationId": "createToken",
"summary": "Generates a new access token",
"x-openai-isConsequential": false,
"responses": {
"200": {
"description": "Token created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"value": {
"type": "string"
},
"expiry": {
"type": "string",
"format": "date-time"
}
}
}
}
}
}
}
}
},
"/api/token/{real_token}/vocabulary": {
"get": {
"operationId": "getAllVocabulary",
"summary": "Retrieves all vocabulary associated with the specified token",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "real_token",
"in": "path",
"required": true,
"description": "The user's token to access all associated vocabulary data",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of all vocabulary categories and words",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"vocabulary": {
"type": "string"
},
"words": {
"type": "array",
"items": {
"type": "object",
"properties": {
"word": {
"type": "string"
},
"summary": {
"type": "string"
},
"date_added": {
"type": "string",
"format": "date-time"
},
"review_times": {
"type": "array",
"items": {
"type": "string",
"format": "date-time"
}
},
"note": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"404": {
"description": "Token not found or has expired",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/vocabulary/{old_vocabulary}/rename/{new_vocabulary}": {
"put": {
"operationId": "renameVocabulary",
"summary": "Renames a specified vocabulary for a given token",
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "old_vocabulary",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "new_vocabulary",
"in": "path",
"required": true,
"schema": {
"type": "string",
"description": "The new name for the vocabulary"
}
}
],
"responses": {
"200": {
"description": "The vocabulary was successfully renamed",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"modified_count": {
"type": "integer"
}
}
}
}
}
},
"404": {
"description": "Token or vocabulary not found, or rename failed",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/preferences": {
"post": {
"operationId": "updateTokenPreferences",
"summary": "Updates preferences for a specified token",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"preferences": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Preferences updated successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "Token not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/word/{word}/exists": {
"get": {
"operationId": "checkWordExists",
"summary": "Checks if a word exists in the user's vocabulary",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "word",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Word existence check result",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"exists": {
"type": "boolean"
}
}
}
}
}
},
"404": {
"description": "Token or word not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/batch-add-words": {
"post": {
"operationId": "batchAddWords",
"summary": "Batch add words to the specified token's vocabulary",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"description": "The user's token to add words to",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BatchWordRequest"
}
}
}
},
"responses": {
"200": {
"description": "Batch add completed successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/topics": {
"get": {
"operationId": "getTopics",
"summary": "Retrieves all topics for a specified level and mode",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "level",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "mode",
"in": "query",
"required": false,
"schema": {
"type": "string",
"default": "talk"
}
}
],
"responses": {
"200": {
"description": "A list of topics",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"level": {
"type": "string"
},
"topic": {
"type": "string"
},
"description": {
"type": "string"
},
"mode": {
"type": "string"
}
}
}
}
}
}
},
"404": {
"description": "No topics found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/feedback/{token}": {
"post": {
"operationId": "collectFeedback",
"summary": "Collects user feedback",
"x-openai-isConsequential": false,
"parameters": [
{
"in": "path",
"name": "token",
"required": true,
"schema": {
"type": "string"
},
"description": "The user's token to associate feedback"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Feedback"
}
}
}
},
"responses": {
"200": {
"description": "Feedback submitted successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "Token not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
},
"500": {
"description": "Failed to submit feedback",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/prompts/{mode}": {
"get": {
"operationId": "getPromptsByMode",
"summary": "Retrieves a list of prompts based on the specified mode",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "mode",
"in": "path",
"required": true,
"description": "The mode for which to retrieve prompts",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "List of prompts for the specified mode",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"mode": {
"type": "string"
},
"prompt": {
"type": "string"
}
}
}
}
}
}
},
"404": {
"description": "No prompts found for this mode",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/review": {
"get": {
"summary": "Get words for review based on spaced repetition algorithm",
"operationId": "getWordsForReview",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A list of words to review",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"word": {
"type": "string"
},
"summary": {
"type": "string"
},
"date_added": {
"type": "string",
"format": "date-time"
},
"last_reviewed": {
"type": "string",
"format": "date-time"
},
"interval": {
"type": "integer"
},
"ef": {
"type": "number",
"format": "float"
},
"note": {
"type": "string"
},
"image_url": {
"type": "string"
},
"mastered": {
"type": "boolean"
}
}
}
}
}
}
},
"404": {
"description": "Token not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
},
"post": {
"summary": "Update review feedback for a word",
"operationId": "updateWordReview",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"word": {
"type": "string",
"description": "The word to review"
},
"quality": {
"type": "integer",
"description": "Feedback rating from 1 to 5"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Review updated successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"next_review_date": {
"type": "string",
"format": "date-time"
}
}
}
}
}
},
"404": {
"description": "Word not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/vocabulary/{vocabulary}/words/master": {
"put": {
"summary": "Mark a word as mastered",
"operationId": "markWordAsMastered",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "vocabulary",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"word": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Word marked as mastered",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "Word not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/track": {
"post": {
"summary": "Create a new user action track",
"operationId": "trackUser",
"x-openai-isConsequential": false,
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string",
"example": "user_token_123"
},
"action": {
"type": "string",
"example": "User learned 5 traffic related words"
},
"details": {
"type": "string",
"example": "User learned roundabout, traffic light, zebra crossing"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Track created successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "60d21b4667d0d8992e610c85"
},
"token": {
"type": "string",
"example": "user_token_123"
},
"action": {
"type": "string",
"example": "User learned 5 traffic related words"
},
"timestamp": {
"type": "string",
"format": "date-time",
"example": "2024-05-27T13:05:35Z"
},
"details": {
"type": "string",
"example": "User learned roundabout, traffic light, zebra crossing"
}
}
}
}
}
},
"500": {
"description": "Track creation failed"
}
}
}
},
"/api/track/{token}": {
"get": {
"summary": "Get all tracks for a specific token",
"operationId": "getUserTrackInfo",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string",
"example": "user_token_123"
}
}
],
"responses": {
"200": {
"description": "Successfully retrieved tracks",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"example": "60d21b4667d0d8992e610c85"
},
"token": {
"type": "string",
"example": "user_token_123"
},
"action": {
"type": "string",
"example": "User learned 5 traffic related words"
},
"timestamp": {
"type": "string",
"format": "date-time",
"example": "2024-05-27T13:05:35Z"
},
"details": {
"type": "string",
"example": "User learned roundabout, traffic light, zebra crossing"
}
}
}
}
}
}
},
"404": {
"description": "No tracks found for the token",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/next-topic/{level}/{token}": {
"get": {
"operationId": "getNextTopic",
"summary": "Retrieves the next topic for a user based on their level and progress",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "level",
"in": "path",
"required": true,
"description": "The user's learning level (e.g., Beginner, Intermediate, Advanced)",
"schema": {
"type": "string"
}
},
{
"name": "token",
"in": "path",
"required": true,
"description": "The user's token to track progress",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Next topic to be learned",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"level": {
"type": "string"
},
"order": {
"type": "integer"
},
"topic": {
"type": "string"
},
"description": {
"type": "string"
},
"mode": {
"type": "string"
}
}
}
}
}
},
"404": {
"description": "No topics found for the specified level, or no progress found for the token",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/comprehensive/progress": {
"post": {
"operationId": "saveComprehensiveProgress",
"summary": "Stores the current topic order for a user's comprehensive learning progress",
"x-openai-isConsequential": false,
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "The user's token"
},
"level": {
"type": "string",
"description": "The user's learning level (e.g., Beginner, Intermediate, Advanced)"
},
"current_order": {
"type": "integer",
"description": "The order of the last completed topic"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Progress saved successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"token": {
"type": "string"
},
"level": {
"type": "string"
},
"current_order": {
"type": "integer"
}
}
}
}
}
},
"404": {
"description": "Token or level not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/note": {
"post": {
"operationId": "uploadNote",
"summary": "Uploads a note for the user",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "query",
"required": true,
"description": "The user's token",
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"detail": {
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Note uploaded successfully",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}
},
"400": {
"description": "Invalid input",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/notes": {
"get": {
"operationId": "getNotes",
"summary": "Retrieves notes for the user",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "query",
"required": true,
"description": "The user's token",
"schema": {
"type": "string"
}
},
{
"name": "page",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 1
},
"description": "Page number for pagination"
},
{
"name": "limit",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"default": 10
},
"description": "Number of notes per page"
},
{
"name": "search",
"in": "query",
"required": false,
"schema": {
"type": "string"
},
"description": "Search query for notes"
}
],
"responses": {
"200": {
"description": "List of notes",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"notes": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"detail": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
},
"total": {
"type": "integer"
},
"page": {
"type": "integer"
},
"limit": {
"type": "integer"
}
}
}
}
}
},
"404": {
"description": "No notes found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/api/token/{token}/words/check": {
"post": {
"summary": "Check multiple words for existence",
"operationId": "checkWordsExist",
"x-openai-isConsequential": false,
"parameters": [
{
"name": "token",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"words": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of words to check"
}
}
}
}
}
},
"responses": {
"200": {
"description": "Result of the word existence check",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"exists": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of words that exist"
},
"not_exists": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of words that do not exist"
}
}
}
}
}
},
"404": {
"description": "Token not found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"detail": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"WordEntry": {
"type": "object",
"properties": {
"word": {
"type": "string"
},
"summary": {
"type": "string"
}
}
},
"BatchWordEntry": {
"type": "object",
"properties": {
"word": {
"type": "string"
},
"vocabulary": {
"type": "string"
},
"summary": {
"type": "string"
},
"note": {
"type": "string"
}
}
},
"BatchWordRequest": {
"type": "object",
"properties": {
"words": {
"type": "array",
"items": {
"$ref": "#/components/schemas/BatchWordEntry"
}
}
}
},
"Topic": {
"type": "object",
"properties": {
"level": {
"type": "string"
},
"topic": {
"type": "string"
},
"description": {
"type": "string"
},
"mode": {
"type": "string"
}
}
},
"Feedback": {
"type": "object",
"properties": {
"feedback": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
}
}
}