Back to top

Oengus API

マラソン

全マラソン情報取得

全マラソン情報取得
GET/api/marathon/

  • Oengusに登録されている全マラソン情報を取得する。

Example URI

GET https://oengus.io/api/marathon/
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "live": [
    {
      "country": "JP",
      "endDate": "2019-12-31T12:00:27Z",
      "id": "rtaij2019",
      "language": "ja",
      "location": "秋葉原ハンドレッドスクエア倶楽部",
      "name": "RTA in Japan 2019",
      "onsite": "true",
      "startDate": "2019-12-27T03:00:27Z"
    }
  ],
  "next": [
    {
      "country": "JP",
      "endDate": "2019-12-31T12:00:27Z",
      "id": "rtaij2019",
      "language": "ja",
      "location": "秋葉原ハンドレッドスクエア倶楽部",
      "name": "RTA in Japan 2019",
      "onsite": "true",
      "startDate": "2019-12-27T03:00:27Z"
    }
  ],
  "open": [
    {
      "country": "JP",
      "endDate": "2019-12-31T12:00:27Z",
      "id": "rtaij2019",
      "language": "ja",
      "location": "秋葉原ハンドレッドスクエア倶楽部",
      "name": "RTA in Japan 2019",
      "onsite": "true",
      "startDate": "2019-12-27T03:00:27Z"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "live": {
      "type": "array",
      "description": "開催中のマラソン"
    },
    "next": {
      "type": "array",
      "description": "今後のマラソン"
    },
    "open": {
      "type": "array",
      "description": "応募受付中のマラソン"
    }
  }
}

マラソン情報取得

マラソン情報取得
GET/api/marathon/{marathonName}

  • 指定したマラソン情報を取得する。

Example URI

GET https://oengus.io/api/marathon/rtaij2019
URI Parameters
HideShow
marathonName
string (required) Example: rtaij2019

マラソン名

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "country": "JP",
  "creator": {
    "id": 1,
    "roles": [
      "ROLE_USER"
    ],
    "speedruncomName": "srcusers1",
    "twitchName": "twitchusers1",
    "twitterName": "twitteruser1",
    "username": "users1",
    "usernameJapanese": "ユーザ"
  },
  "defaultSetupTime": "PT10M",
  "description": "ゲーム募集は9/14から9/29です",
  "discord": "xxxxxx",
  "discordPrivacy": false,
  "endDate": "2019",
  "hasMultiplayer": true,
  "id": "rtaij2019",
  "language": "ja",
  "location": "秋葉原ハンドレッドスクエア倶楽部",
  "maxCategoriesPerGame": 3,
  "maxGamesPerRunner": 5,
  "maxNumberOfScreens": 2,
  "moderators": [
    {
      "id": 1,
      "roles": [
        "ROLE_USER"
      ],
      "speedruncomName": "srcusers1",
      "twitchName": "twitchusers1",
      "twitterName": "twitteruser1",
      "username": "users1",
      "usernameJapanese": "ユーザ"
    }
  ],
  "name": "RTA in Japan 2019",
  "onsite": true,
  "scheduleDone": false,
  "selectionDone": false,
  "startDate": "2019-12-27T03:00:27Z",
  "submitsOpen": true,
  "twitch": "rtainjapan",
  "twitter": "rtainjapan"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "country": {
      "type": "string",
      "description": "国"
    },
    "creator": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "ユーザID"
        },
        "roles": {
          "type": "array"
        },
        "speedruncomName": {
          "type": "string",
          "description": "Speedrun.comのユーザ名"
        },
        "twitchName": {
          "type": "string",
          "description": "Twitchのユーザ名"
        },
        "twitterName": {
          "type": "string",
          "description": "Twitterのユーザ名"
        },
        "username": {
          "type": "string",
          "description": "Oengusのユーザ名"
        },
        "usernameJapanese": {
          "type": "string",
          "description": "Oengus日本語表示でのユーザ名。未設定はnull"
        }
      },
      "description": "マラソン作成者"
    },
    "defaultSetupTime": {
      "type": "string",
      "description": "セットアップタイム"
    },
    "description": {
      "type": "string",
      "description": "マラソンの説明。改行が入ることもある。"
    },
    "discord": {
      "type": "string",
      "description": "Discord招待リンクの末尾ID。"
    },
    "discordPrivacy": {
      "type": "boolean",
      "description": "Discordプライベート設定"
    },
    "endDate": {
      "type": "string",
      "description": "12-31T12:00:27Z (string) - マラソン終了日時"
    },
    "hasMultiplayer": {
      "type": "boolean",
      "description": "協力プレイ可否"
    },
    "id": {
      "type": "string",
      "description": "マラソンID"
    },
    "language": {
      "type": "string",
      "description": "言語"
    },
    "location": {
      "type": "string",
      "description": "開催場所"
    },
    "maxCategoriesPerGame": {
      "type": "number",
      "description": "応募可能なカテゴリー数(ゲームごと)"
    },
    "maxGamesPerRunner": {
      "type": "number",
      "description": "応募可能なゲーム数"
    },
    "maxNumberOfScreens": {
      "type": "number",
      "description": "画面数"
    },
    "moderators": {
      "type": "array",
      "description": "モデレータ一覧"
    },
    "name": {
      "type": "string",
      "description": "マラソン名"
    },
    "onsite": {
      "type": "boolean",
      "description": "オフラインかオンラインか"
    },
    "scheduleDone": {
      "type": "boolean"
    },
    "selectionDone": {
      "type": "boolean",
      "description": "ゲーム選考完了フラグ"
    },
    "startDate": {
      "type": "string",
      "description": "マラソン開始時刻"
    },
    "submitsOpen": {
      "type": "boolean",
      "description": "応募受付中"
    },
    "twitch": {
      "type": "string",
      "description": "マラソンに紐づくTwitchユーザ名"
    },
    "twitter": {
      "type": "string",
      "description": "マラソンに紐づくTwitterユーザ名"
    }
  }
}

ゲーム情報

ゲーム情報
GET/api/marathon/{marathonName}/game

  • 応募された全てのゲームの情報を取得する。

Example URI

GET https://oengus.io/api/marathon/rtaij2019/game
URI Parameters
HideShow
marathonName
string (required) Example: rtaij2019

マラソン名

Response  200
HideShow
Headers
Content-Type: application/json
Body
[
  {
    "categories": [
      {
        "description": "何でもいいから早くクリアします。",
        "estimate": "PT1H40M",
        "id": 1,
        "name": "Any%",
        "video": "http://example.com/"
      }
    ],
    "console": "PC",
    "description": "とにかくすごいゲームです。",
    "emulated": false,
    "id": 1,
    "name": "スゴイゲーム",
    "ratio": "4:3",
    "user": {
      "id": 1,
      "roles": [
        "ROLE_USER"
      ],
      "speedruncomName": "srcusers1",
      "twitchName": "twitchusers1",
      "twitterName": "twitteruser1",
      "username": "users1",
      "usernameJapanese": "ユーザ"
    }
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "categories": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "description": {
              "type": "string",
              "description": "カテゴリ説明。改行が入ることもある。"
            },
            "estimate": {
              "type": "string",
              "description": "予定タイム"
            },
            "id": {
              "type": "number",
              "description": "カテゴリーID"
            },
            "name": {
              "type": "string",
              "description": "カテゴリ名"
            },
            "video": {
              "type": "string",
              "description": "参考動画URL"
            }
          }
        },
        "description": "ゲームのカテゴリ"
      },
      "console": {
        "type": "string",
        "description": "ゲームハード"
      },
      "description": {
        "type": "string",
        "description": "ゲーム説明。改行が入ることもある。"
      },
      "emulated": {
        "type": "boolean",
        "description": "エミュレーター使用"
      },
      "id": {
        "type": "number",
        "description": "ゲームID"
      },
      "name": {
        "type": "string",
        "description": "ゲーム名"
      },
      "ratio": {
        "type": "string",
        "description": "アスペクト比"
      },
      "user": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ユーザID"
          },
          "roles": {
            "type": "array"
          },
          "speedruncomName": {
            "type": "string",
            "description": "Speedrun.comのユーザ名"
          },
          "twitchName": {
            "type": "string",
            "description": "Twitchのユーザ名"
          },
          "twitterName": {
            "type": "string",
            "description": "Twitterのユーザ名"
          },
          "username": {
            "type": "string",
            "description": "Oengusのユーザ名"
          },
          "usernameJapanese": {
            "type": "string",
            "description": "Oengus日本語表示でのユーザ名。未設定はnull"
          }
        },
        "description": "ユーザ情報"
      }
    }
  }
}

ゲーム応募

ゲーム応募
POST/api/marathon/{marathonName}/submission

  • ゲームを応募する

Example URI

POST https://oengus.io/api/marathon/rtaij2019/submission
URI Parameters
HideShow
marathonName
string (required) Example: rtaij2019

マラソン名

Request
HideShow
Headers
Content-Type: application/json
Body
{
  "availabilities": [
    {
      "from": "2019-09-22T18:58:52.000Z",
      "to": "2019-09-29T18:57:58.000Z"
    }
  ],
  "games": [
    {
      "categories": [
        {
          "description": "何でもいいから早くクリアします。",
          "estimate": "PT1H40M",
          "id": 1,
          "name": "Any%",
          "video": "http://example.com/"
        }
      ],
      "console": "PC",
      "description": "とにかくすごいゲームです。",
      "emulated": false,
      "id": 1,
      "name": "スゴイゲーム",
      "ratio": "4:3",
      "user": {
        "id": 1,
        "roles": [
          "ROLE_USER"
        ],
        "speedruncomName": "srcusers1",
        "twitchName": "twitchusers1",
        "twitterName": "twitteruser1",
        "username": "users1",
        "usernameJapanese": "ユーザ"
      }
    }
  ],
  "user": {
    "id": 1,
    "roles": [
      "ROLE_USER"
    ],
    "speedruncomName": "srcusers1",
    "twitchName": "twitchusers1",
    "twitterName": "twitteruser1",
    "username": "users1",
    "usernameJapanese": "ユーザ"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "availabilities": {
      "type": "array",
      "description": "参加可能日時"
    },
    "games": {
      "type": "array",
      "description": "ゲーム情報"
    },
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "ユーザID"
        },
        "roles": {
          "type": "array"
        },
        "speedruncomName": {
          "type": "string",
          "description": "Speedrun.comのユーザ名"
        },
        "twitchName": {
          "type": "string",
          "description": "Twitchのユーザ名"
        },
        "twitterName": {
          "type": "string",
          "description": "Twitterのユーザ名"
        },
        "username": {
          "type": "string",
          "description": "Oengusのユーザ名"
        },
        "usernameJapanese": {
          "type": "string",
          "description": "Oengus日本語表示でのユーザ名。未設定はnull"
        }
      },
      "description": "ユーザ情報。初回は空オブジェクト"
    }
  }
}
Response  201
HideShow
Headers
Content-Type: application/json

選考状態取得

選考状態取得
GET/api/marathon/{marathonName}/selection?status=

  • 選考状態を取得する。

Example URI

GET https://oengus.io/api/marathon/rtaij2019/selection?status=
URI Parameters
HideShow
marathonName
string (required) Example: rtaij2019

マラソン名

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "24": {
    "categoryId": 24,
    "id": 24,
    "status": "BONUS"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "$ref": "#/definitions/24",
  "definitions": {
    "24": {
      "type": "object",
      "patternProperties": {
        "": {
          "type": "object",
          "properties": {
            "categoryId": {
              "type": "number",
              "description": "カテゴリーID"
            },
            "id": {
              "type": "number",
              "description": "ゲームID"
            },
            "status": {
              "type": "string",
              "description": "選考結果。当選:VALIDATED 落選:REJECTED 選考中:TODO ボーナス:BONUS"
            }
          }
        }
      }
    }
  }
}

ユーザ

ログイン中のユーザ情報

ログイン中のユーザ情報
GET/api/user/me

Example URI

GET https://oengus.io/api/user/me
Response  200
HideShow
  • 正常に取得
Headers
Content-Type: application/json
Body
[
  {
    "discordId": "1234567890",
    "discordName": "RTAちゃん#7144",
    "enabled": true,
    "id": 1,
    "roles": [
      "ROLE_USER"
    ],
    "speedruncomName": "srcusers1",
    "twitchName": "twitchusers1",
    "twitterName": "twitteruser1",
    "username": "users1",
    "usernameJapanese": "ユーザ"
  }
]
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "discordId": {
        "type": "string"
      },
      "discordName": {
        "type": "string"
      },
      "enabled": {
        "type": "boolean"
      },
      "id": {
        "type": "number",
        "description": "ユーザID"
      },
      "roles": {
        "type": "array"
      },
      "speedruncomName": {
        "type": "string",
        "description": "Speedrun.comのユーザ名"
      },
      "twitchName": {
        "type": "string",
        "description": "Twitchのユーザ名"
      },
      "twitterName": {
        "type": "string",
        "description": "Twitterのユーザ名"
      },
      "username": {
        "type": "string",
        "description": "Oengusのユーザ名"
      },
      "usernameJapanese": {
        "type": "string",
        "description": "Oengus日本語表示でのユーザ名。未設定はnull"
      }
    }
  }
}

エラー

GETエラー

GETエラー
GET/

  • 恐らくすべてのエンドポイントにおいて共通のエラー

Example URI

GET https://oengus.io/
Response  401
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "Unauthorized",
  "message": "Access is denied",
  "path": "/api/user/me",
  "status": 401,
  "timestamp": "2019-09-21T15:12:13.171+0000"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "error": {
      "type": "string",
      "description": "エラー分類"
    },
    "message": {
      "type": "string",
      "description": "エラーメッセージ"
    },
    "path": {
      "type": "string",
      "description": "APIパス"
    },
    "status": {
      "type": "number",
      "description": "エラーコード"
    },
    "timestamp": {
      "type": "string",
      "description": "リクエスト時刻"
    }
  }
}

Generated by aglio on 22 Sep 2019