*works_list.json:ワークス名一覧
*local_list.json:地方名一覧
=成功したAPI=
✅ 認証系 API
① 一般ユーザ登録
curl -X POST http://localhost/api/user/register \
-H "Content-Type: application/json" \
-c cookie.txt \
-d '{"display":"ギルドの誰か","id":"testuser","pass":"testpass"}'
② ログイン(一般 or 管理者)
curl -X POST http://localhost/api/user/login \
-H "Content-Type: application/json" \
-b cookie.txt -c cookie.txt \
-d '{"id":"testuser","pass":"testpass"}'
③ 現在のログイン状態確認
curl http://localhost/api/user/me -b cookie.txt
④ ログアウト
curl http://localhost/api/user/logout -b cookie.txt -c cookie.txt
⑤ 一般ユーザの削除(自分で削除)
curl -X POST http://localhost/api/user/delete -b cookie.txt -c cookie.txt
curl -X POST http://localhost/api/char/create \
-H "Content-Type: application/json" \
-b cookie.txt -c cookie.txt \
-d '{
"name": "テストキャラ",
"sheetUrl": "https://example.com/sheet123",
"description": "テスト用キャラクターです\n改行もできるよ",
"tags": "テスト,TRPG,ファンタジー"
}'
✅ キャラクター関連API
curl -X POST http://localhost/api/char/create \
-H "Content-Type: application/json" \
-b cookie.txt -c cookie.txt \
-d '{
"name": "テストキャラ",
"sheetUrl": "https://example.com/sheet123",
"description": "テスト用キャラクターです\n改行もできるよ",
"tags": "テスト,TRPG,ファンタジー"
}'
★作成されたキャラ
"938146af": {
"id": "938146af",
"userId": "testuser",
"name": "テストキャラ",
"sheetUrl": "https:\/\/example.com\/sheet123",
"description": "テスト用キャラクターです\n改行もできるよ",
"tags": "テスト,TRPG,ファンタジー"
}
✅ ユニット関連
curl -X POST http://localhost/api/unit/create \
-H "Content-Type: application/json" \
-b cookie.txt \
-d '{
"name": "テストユニット",
"description": "これはテスト用のユニットです。",
"works": "冒険者",
"location": {
"place_name": "キングスフォール",
"region": "ドーデン地方",
"scale": "村"
},
"base": {
"base_name": "宿屋",
"base_description": "街の普通の宿屋だよ!",
"base_cost": 500
},
"skill_type": "冒険者"
}'
ユニット更新&メンバー追加
curl -X POST http://localhost/api/unit/update \
-H "Content-Type: application/json" \
-b cookie.txt \
-d '{
"id": "eda3130a",
"name": "テストユニット",
"description": "これはテスト用のユニットです。",
"works": "冒険者",
"location": {
"place_name": "キングスフォール",
"region": "ドーデン地方",
"scale": "村"
},
"base": {
"base_name": "宿屋",
"base_description": "街の普通の宿屋だよ!",
"base_cost": 500
},
"skill_type": "冒険者",
"members": [
{
"character_id": "938146af",
"position": "リーダー",
"level": 4
},
{
"character_id": "5273a941",
"position": "サポーター",
"level": 1
}
]
}'
メンバー削除
curl -X POST http://localhost/api/unit/update \
-H "Content-Type: application/json" \
-b cookie.txt \
-d '{
"id": "eda3130a",
"name": "テストユニット",
"description": "これはテスト用のユニットです。",
"works": "冒険者",
"location": {
"place_name": "キングスフォール",
"region": "ドーデン地方",
"scale": "村"
},
"base": {
"base_name": "宿屋",
"base_description": "街の普通の宿屋だよ!",
"base_cost": 500
},
"skill_type": "冒険者",
"members": []
}'