Dokümanlar/API ve Webhook'lar/Özel Kurslar

Özel Kurslar

Özel kurs; SecureCodingHub içerik kataloğundan derlenmiş, öğrenciye dönük küratörlü bir konu ve senaryo dizisidir. Oluşturulduktan sonra bir özel kurs, yerleşik bir konu veya kategori gibi atanabilir. Eyleme göre custom-courses:read veya custom-courses:write gerektirir.

Uç noktalar

MethodPathKapsamAmaç
GET/custom-coursescustom-courses:readKurumdaki tüm özel kursları listeler.
GET/custom-courses/{'{'}id{'}'}custom-courses:readSıralı öğeleriyle tek bir özel kursu getirir.
POST/custom-coursescustom-courses:writeYeni bir özel kurs oluşturur.
PATCH/custom-courses/{'{'}id{'}'}custom-courses:writeMeta veriyi günceller ve/veya öğe listesini değiştirir.
DELETE/custom-courses/{'{'}id{'}'}custom-courses:writeBir özel kursu yumuşak şekilde deaktive eder.

Tüm yollar https://api.limeplate.com/api/public/v1 adresine göredir.

Öğe modeli

Her özel kurs sıralı bir öğeler listesi içerir. Her öğe, katalogdaki bir konu veya senaryoya referanstır — tanımlayıcılar için İçerik Kataloğu'e bakın.

AlanTürAnlam
itemTypestring"topic" (sql-injection gibi bir pratik konusu) veya "scenario" (bir öğrenme modu senaryosu).
itemIdstringKonunun veya senaryonun katalog id'si.
orderIndexintegerÖğrenci arayüzündeki sıfır tabanlı görüntüleme sırası. Daha düşük değerler önce görünür.

PATCH sırasında, öğeleri olduğu gibi bırakmak için items alanını atlayın veya üzerine yazmak için tam bir değiştirme listesi gönderin. Kısmi öğe güncellemesi yoktur — diziyi saklanmasını istediğiniz sırayla tamamen yeniden gönderin.

Özel kursları listele

Kurumdaki her aktif özel kurs için en son güncellenenden başlayarak bir girdi döner.

GET /api/public/v1/custom-courses
Authorization: Bearer scs_live_…

Yanıt

[
  {
    "id": "8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02",
    "name": "Backend Onboarding — Q2",
    "description": "Required reading for new backend hires.",
    "icon": "shield",
    "color": "#3b82f6",
    "itemCount": 6,
    "usageCount": 12,
    "createdByUserId": "1a2b3c4d-5e6f-7081-9203-4d5e6f708192",
    "createdByName": "Jane Smith",
    "createdAt": "2026-04-10T09:22:14Z",
    "updatedAt": "2026-05-18T15:01:47Z"
  }
]

Örnek

curl -sS \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/custom-courses

Özel kurs al

Kursu sıralı öğeleri açılmış olarak döner. resolvedTitle, okuma anında altta yatan konunun veya senaryonun insan tarafından okunabilir başlığıdır — ikinci bir katalog araması yapmadan render etmek için kullanışlıdır.

GET /api/public/v1/custom-courses/{customCourseId}
Authorization: Bearer scs_live_…

Yanıt

{
  "id": "8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02",
  "name": "Backend Onboarding — Q2",
  "description": "Required reading for new backend hires.",
  "icon": "shield",
  "color": "#3b82f6",
  "items": [
    {
      "id": "c1d2e3f4-5060-7081-9203-4d5e6f708192",
      "itemType": "topic",
      "itemId": "sql-injection",
      "resolvedTitle": "SQL Injection",
      "orderIndex": 0
    },
    {
      "id": "d2e3f405-6070-8192-0304-5e6f70819203",
      "itemType": "scenario",
      "itemId": "auth-bypass-walkthrough",
      "resolvedTitle": "Auth Bypass Walkthrough",
      "orderIndex": 1
    },
    {
      "id": "e3f40506-7081-9203-0405-6f7081920304",
      "itemType": "topic",
      "itemId": "xss",
      "resolvedTitle": "Cross-Site Scripting",
      "orderIndex": 2
    }
  ],
  "usageCount": 12,
  "createdByUserId": "1a2b3c4d-5e6f-7081-9203-4d5e6f708192",
  "createdByName": "Jane Smith",
  "createdAt": "2026-04-10T09:22:14Z",
  "updatedAt": "2026-05-18T15:01:47Z"
}

Örnek

curl -sS \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/custom-courses/8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02

Özel kurs oluştur

Bir kurs oluşturur ve detay görünümünü döner. Yeni kursu API anahtarının kurumu sahiplenir; anahtarı veren kullanıcı oluşturucu olarak kaydedilir.

POST /api/public/v1/custom-courses
Authorization: Bearer scs_live_…
Content-Type: application/json

İstek gövdesi

{
  "name": "Backend Onboarding — Q2",
  "description": "Required reading for new backend hires.",
  "icon": "shield",
  "color": "#3b82f6",
  "items": [
    { "itemType": "topic",    "itemId": "sql-injection",          "orderIndex": 0 },
    { "itemType": "scenario", "itemId": "auth-bypass-walkthrough", "orderIndex": 1 },
    { "itemType": "topic",    "itemId": "xss",                    "orderIndex": 2 }
  ]
}

name zorunludur ve kurum içinde benzersiz olmalıdır. description, icon ve color isteğe bağlıdır — color herhangi bir CSS hex dizgisini alır. items oluşturma sırasında boş olabilir; daha sonra PATCH ile doldurabilirsiniz.

Yanıt

Özel kurs al ile aynı yapı.

Örnek

curl -sS -X POST \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Backend Onboarding — Q2",
    "description": "Required reading for new backend hires.",
    "icon": "shield",
    "color": "#3b82f6",
    "items": [
      { "itemType": "topic", "itemId": "sql-injection", "orderIndex": 0 },
      { "itemType": "topic", "itemId": "xss",           "orderIndex": 1 }
    ]
  }' \
  https://api.limeplate.com/api/public/v1/custom-courses

Özel kursu güncelle

İstekteki tüm alanlar isteğe bağlıdır. Yalnızca değiştirmek istediğiniz alanları gönderin. items göndermek tüm öğe listesini değiştirir — yeniden sıralamak için her öğeyi yeni orderIndex değerleriyle yeniden gönderin.

PATCH /api/public/v1/custom-courses/{customCourseId}
Authorization: Bearer scs_live_…
Content-Type: application/json

İstek gövdesi

{
  "name": "Backend Onboarding — Q3",
  "items": [
    { "itemType": "topic",    "itemId": "sql-injection", "orderIndex": 0 },
    { "itemType": "topic",    "itemId": "ssrf",          "orderIndex": 1 },
    { "itemType": "scenario", "itemId": "jwt-tampering", "orderIndex": 2 }
  ]
}

Yanıt

Güncellenmiş detay nesnesi.

Örnek

curl -sS -X PATCH \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Backend Onboarding — Q3" }' \
  https://api.limeplate.com/api/public/v1/custom-courses/8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02

Özel kursu sil

Kursu yumuşak şekilde deaktive eder. GET /custom-courses ve öğrenci arayüzlerinde görünmeyi durdurur. Kursa referans veren mevcut atamalar geçmiş ilerlemeyi izlemeye devam eder ama yeni atananlara teslim edilmez.

DELETE /api/public/v1/custom-courses/{customCourseId}
Authorization: Bearer scs_live_…

Yanıt

{ "message": "Custom course deactivated" }

Örnek

curl -sS -X DELETE \
  -H "Authorization: Bearer $SCH_API_KEY" \
  https://api.limeplate.com/api/public/v1/custom-courses/8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02

Özel kurs atama

Bir özel kurs atanana kadar öğrencilere teslim edilmez. targetType: "custom-course" ve targetId alanlarını özel kurs id'sine ayarlayarak Atamalar'i kullanın:

curl -sS -X POST \
  -H "Authorization: Bearer $SCH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "assigneeType": "user",
    "assigneeId": "1a2b3c4d-5e6f-7081-9203-4d5e6f708192",
    "contentArea": "practice",
    "targetType": "custom-course",
    "targetId": "8b1f0c2e-3a45-4d99-9a7e-2c5e1b3a8f02",
    "deadline": "2026-06-15T00:00:00Z",
    "isMandatory": true
  }' \
  https://api.limeplate.com/api/public/v1/assignments

Öğrenci öğeleri orderIndex sırasında görür. Pratik konuları ve öğrenme senaryoları kendi ilerleme uç noktaları altında izlenir — İlerleme'e bakın.