GET /api/v1/classes/{classId}/cardsํค๋ | ๊ฐ | ํ์ |
X-API-Key | ๋ฐ๊ธ๋ฐ์ API ํค | โ
|
{
"success": true,
"data": {
"cards": [
{
"templateId": "abc123",
"type": "reward",
"points": 5,
"description": "์์
์ ๊ทน ์ฐธ์ฌ",
"categoryId": "cat_collab",
"categoryName": "ํ์
"
}
]
},
"message": "์ญ๋ ์นด๋ ๋ชฉ๋ก ์กฐํ์ ์ฑ๊ณตํ์ต๋๋ค."
}ํ๋ | ์ค๋ช
|
templateId | ์นด๋ ๋ถ์ฌ ์ ์ฌ์ฉํ๋ ์นด๋ ID |
type | reward(์นญ์ฐฌ) / penalty(๋
ธ๋ ฅ) |
points | ์นด๋์ ์ค์ ๋ ์ ์ |
description | ์นด๋ ์ค๋ช
|
categoryId / categoryName | ์ฐ๊ฒฐ๋ ์ญ๋ ์นดํ
๊ณ ๋ฆฌ (์์ผ๋ฉด null) |
POST /api/v1/classes/{classId}/students/{studentCode}/cardsํ๋ผ๋ฏธํฐ | ํ์
| ์ค๋ช
|
classId | string | ํด๋์ค ID |
studentCode | number | ํ์ ๋ฒํธ(์ถ์๋ฒํธ) |
ํ๋ | ํ์
| ํ์ | ์ค๋ช
|
templateId | string | โ
| ๋ถ์ฌํ ์ญ๋ ์นด๋ ID (๋ชฉ๋ก ์กฐํ๋ก ํ๋) |
source | string | โ | ์ถ์ฒ ์๋ณ์ (๊ธฐ๋ณธ๊ฐ "cardTemplate") |
metadata | object | โ | ์ถ๊ฐ ๋ฐ์ดํฐ |
curl -X POST \
"https://growndcard.com/api/v1/classes/CLASS_ID/students/2/cards" \
-H "Content-Type: application/json" \
-H "X-API-Key: sk_live_xxx" \
-d '{ "templateId": "abc123", "source": "QuizApp" }'{
"success": true,
"data": {
"recordId": "rec_xyz",
"studentId": "stu_abc",
"studentCode": 2,
"type": "reward",
"pointsAwarded": 5,
"bonusApplied": 1,
"totalPoints": 155,
"currentLevel": 5,
"leveledUp": false,
"createdAt": "2026-06-15T01:23:45.000Z",
"templateId": "abc123",
"categoryId": "cat_collab"
},
"message": "์ญ๋ ์นด๋๊ฐ ์ฑ๊ณต์ ์ผ๋ก ๋ถ์ฌ๋์์ต๋๋ค."
}์ํ | ์ฝ๋ | ์ค๋ช
|
400 | invalid_student_code | ํ์ ๋ฒํธ ๋๋ฝ |
400 | invalid_template_id | templateId ๋๋ฝ ๋๋ ํ์ ์ค๋ฅ |
401 | unauthorized | API ํค ๋๋ฝ/๋ฌดํจ |
403 | insufficient_permissions | awardPoints ๊ถํ ์์ |
403 | forbidden | ํด๋น ํด๋์ค ์ ๊ทผ ๊ถํ ์์ |
404 | card_not_found | ํด๋น ์ญ๋ ์นด๋ ์์ |
404 | student_not_found | ํ์์ ์ฐพ์ ์ ์์ |
429 | rate_limit_exceeded | ํธ์ถ ์ ํ ์ด๊ณผ |
500 | invalid_card_template | ์นด๋ ํ
ํ๋ฆฟ ๋ฐ์ดํฐ ์์(type/points ์ด์) |
500 | internal_error | ์๋ฒ ๋ด๋ถ ์ค๋ฅ |