api:v1
目次
ModParks API Documentation (v1)
全エンドポイントは ``/api/v1`` をプレフィックスとする。
認証
読み取り系のパブリックエンドポイントは認証不要だ。
一部の保護されたエンドポイントは ``Authorization`` ヘッダーに Bearer トークンが必要となる。
Authorization: Bearer <your_api_key>
認証が必要なエンドポイントに対してヘッダーが不正・欠落している場合:
{
"error": "Missing or invalid Authorization header"
}
Projects API
GET /api/v1/projects/[slug]
指定スラッグのプロジェクト詳細を取得する。
| 項目 | 内容 |
|---|---|
| Method | ``GET`` |
| 認証 | 不要 |
Response (200 OK)
{
"id": "12345",
"slug": "sample-mod",
"name": "Sample Mod",
"description": "A sample mod for Minecraft",
"iconUrl": "https://example.com/icon.png",
"type": "mod",
"license": "MIT",
"sourceUrl": "https://github.com/...",
"downloads": 1500,
"createdAt": "2026-01-01T00:00:00Z",
"updatedAt": "2026-06-01T00:00:00Z",
"author": {
"username": "Pitan76",
"displayName": "Pitan",
"avatarUrl": "https://github.com/..."
},
"categories": ["Utility", "Magic"],
"tags": ["fabric", "forge"]
}
Error (404 Not Found): プロジェクトが存在しないか非公開の場合。
Versions API
GET /api/v1/projects/[slug]/versions
指定プロジェクトの全バージョン一覧を取得する。
| 項目 | 内容 |
|---|---|
| Method | ``GET`` |
| 認証 | 不要 |
Response (200 OK)
{
"versions": [
{
"id": "abc-123",
"versionNumber": "1.0.0",
"mcVersions": ["1.20.1", "1.20.2"],
"loaders": ["fabric", "forge"],
"changelog": "Initial release",
"fileUrl": "https://...",
"fileName": "sample-mod-1.0.0.jar",
"fileSize": 1024000,
"downloads": 500,
"createdAt": "2026-06-01T00:00:00Z"
}
]
}
Users API
GET /api/v1/users/[username]
指定ユーザーの公開プロフィールを取得する。
| 項目 | 内容 |
|---|---|
| Method | ``GET`` |
| 認証 | 不要 |
Response (200 OK)
{
"id": "user-123",
"username": "Pitan76",
"displayName": "Pitan",
"avatarUrl": "https://github.com/...",
"bio": "Minecraft Mod Developer",
"createdAt": "2026-01-01T00:00:00Z"
}
Error (404 Not Found): ユーザーが存在しない場合。
Ideas API
GET /api/v1/ideas
アイデアボードの投稿一覧を取得する。
| 項目 | 内容 |
|---|---|
| Method | ``GET`` |
| 認証 | 不要 |
Query Parameters
| パラメータ | 必須 | デフォルト | 最大値 | 説明 |
|---|---|---|---|---|
| ``limit`` | 任意 | 20 | 50 | 取得件数 |
Response (200 OK)
{
"ideas": [
{
"id": "idea-1",
"title": "We need a better minimap mod",
"description": "It would be great if...",
"author": {
"username": "player1",
"avatarUrl": "https://..."
},
"createdAt": "2026-06-01T00:00:00Z"
}
]
}
Current User Profile API(要認証)
GET /api/v1/profile
ログイン中ユーザー自身のプロフィールを取得する。
| 項目 | 内容 |
|---|---|
| Method | ``GET`` |
| 認証 | 必要(セッション Cookie) |
Response (200 OK)
{
"id": "user-123",
"username": "Pitan76",
"displayName": "Pitan",
"avatarUrl": "https://github.com/...",
"bio": "Minecraft Mod Developer",
"locale": "ja"
}
Error (401 Unauthorized): 未ログインの場合。
関連ページ
api/v1.txt · 最終更新: by admin
