Lingara Lingara 說明文件 學習指南 API 函式庫 應用程式 起造 網頁版
語言: 閩南語

取得課程計畫

API 版本 2026-10-golden-remora

get https://api.getlingara.com/v1/lesson-plans/{id}

回傳你擁有的課程計畫。猶咧產生的計畫猶未有 content。

權限範圍 lesson_plans:read

參數

Lingara-Versionheaderstring選填
回應這个請求所用的 API 版本。無這个的話,存取權杖會用伊的用戶端綁定的版本,無權杖的請求會用這馬的版本。猶咧開發的版本,干焦佇遮講明才用會著。毋捌的版本會回 400,代碼是 api_version_unknown。GET /v1/versions 會列出所有版本。
idpathstring必填

回應

200 課程計畫

idstring必填
statusPlanStatus必填
titlestring | null選填
source_langstring必填
target_langstring必填
levelinteger必填
created_atstring必填
completed_atstring | null選填
ai_generatedboolean必填
contentLessonPlanContent | null選填
introductionstring | null選填
learning_objectivesarray of string必填
vocabularyarray of PlanWord必填
wordstring必填
pronunciationstring | null選填
translationstring必填
setsarray of PlanSet必填
numberinteger必填
contextstring | null選填
questionsarray of PlanQuestion必填
typestring必填
promptstring必填
optionsarray of string | null選填
answerstring必填
explanationstring必填
hintstring | null選填

錯誤

410application/json
回應這个請求所用的 API 版本已經停用。請佇 Lingara-Version 送一个有支援的版本,抑是共用戶端綁去別个版本。
4XXapplication/json
請求予人拒絕矣。code 講原因,error 用文字講明。
503application/json · text/plain
服務暫時無法度使用;請等 Retry-After 內底的秒數過了閣試。維護期間,內容是純文字,毋是錯誤封包。
5XXapplication/json
請求予人拒絕矣。code 講原因,error 用文字講明。
codestring必填

請求予人拒絕的原因,是一个穩定的代碼,會當用來分支處理:比如 insufficient_scope(403)、rate_limited(429),對照用量計費的用戶端閣有 spend_cap_reached(402)佮 metered_billing_inactive(402)。

errorstring必填

範例

程式碼範例的語言

curl

curl "https://api.getlingara.com/v1/lesson-plans/$ID" \
  -H "Authorization: Bearer $LINGARA_TOKEN"

TypeScript

const plan = await client.getLessonPlan({ id: planId });
console.log(plan.status, plan.title);

Rust

let plan = client.get_lesson_plan(&plan_id).await?;
println!("{:?} {}", plan.status, plan.title.as_deref().unwrap_or("(untitled)"));

Go

plan, err := client.GetLessonPlan(ctx, "3f1c2a9e-5b7d-4e21-9a0c-6d8e4f2b1a37")
if err != nil {
	return err
}
fmt.Println(plan.Value.Status, plan.Value.CreatedAt)

Java

import com.getlingara.client.model.LessonPlan;

LessonPlan plan = client.getLessonPlan(planId).body();
System.out.println(plan.getTitle() + " (" + plan.getStatus() + ")");

Kotlin

val plan = client.getLessonPlan(planId).body
println("${plan.title} (${plan.status})")

Ruby

plan = client.get_lesson_plan(plan_id).value
puts "#{plan.title} (#{plan.status})"
plan.content&.vocabulary&.each { |word| puts "#{word.word}: #{word.translation}" }

PHP

$plan = $client->getLessonPlan($planId)->value;
echo $plan->getTitle(), ' (', $plan->getStatus()->value, ")\n";

想欲用函式庫?請看函式庫這節。

若是翻譯佮英文參考文件無仝,就以英文參考文件為準。