Skip to content

Latest commit

 

History

History
411 lines (376 loc) · 5.85 KB

endpoints.md

File metadata and controls

411 lines (376 loc) · 5.85 KB

Endpoints

root endpoints: /

GET /status

Current API status.

headers

payload

{
}

response

{
  "api": "ok",
  "gate": "ok",
  "db": "ok"
}

DDR endpoints: /ddr

PATCH /ddr/profile/update

Update user profile with latest statistics and scores.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
}

response

{
  "status": "ok"
}

PATCH /ddr/profile/refresh

Re-process statistics for all difficulties.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
}

response

{
  "status": "ok"
}

GET /ddr/songs

List of songs currently in the database.

headers


payload

{
  "order_by":
  [
    "Name",
    "Artist DESC",
    "Id ASC"
  ] OPTIONAL
}

response

[
  {
    "Id":"1a2b3c4d5e6f",
    "Name":"My First Song",
    "Artist":"Bemani Sound Team"
  },
  {
    "Id":"a1b2c3d4e5f6",
    "Name":"My Second Song",
    "Artist":"Bemani Sound Team"
  },
  ...
]

PATCH /ddr/songs

Update songs in database.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
}

response

{
  "status": "ok",
  "message": "added 100 new songs (800 new difficulties)"
}

GET /ddr/songs/jackets

List of jackets for provided songs.

headers

payload

{
  "ids":
  [
    "1a2b3c4d5e6f",
    "a1b2c3d4e5f6",
    ...
  ]
}

response

[
  {
    "id": "1a2b3c4d5e6f",
    "jacket": "base64encoded="
  },
  {
    "id": "a1b2c3d4e5f6",
    "jacket": "base64encoded="
  },
  ...
]

GET /ddr/songs/{id: song_id}

Get details for provided song id.

headers

payload

{
}

response

{
  "id":"1a2b3c4d5e6f",
  "name":"A song name",
  "artist":"A song artist",
  "image":"abase64encodedimage=",
  "difficulties":
  [
    {
      "mode": "SINGLE",
      "difficulty": "BEGINNER",
      "difficultyvalue": 1
    },
    {
      "mode": "SINGLE",
      "difficulty": "BASIC",
      "difficultyvalue": 3
    },
    ...
  ]
}

GET /ddr/songs/scores

List of users top scores.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
  "ids": [
    "{{song_id}}",
    "{{song_id}}",
    ...
  ], OPTIONAL ✅
  "order_by": "{{field_name}}" OPTIONAL ❌
}

response

[
    {
        "BestScore": 934510,
        "Lamp": "---",
        "Rank": "AA",
        "PlayCount": 1,
        "ClearCount": 1,
        "MaxCombo": 200,
        "LastPlayed": "2018-06-19T04:54:50Z",
        "SongId": "88do8dl8O6Ql1Qlb981lOi8D86oiq91P",
        "Mode": "SINGLE",
        "Difficulty": "EXPERT",
        "PlayerCode": 12312322
    },
    {
        "BestScore": 979650,
        "Lamp": "グレートフルコンボ",
        "Rank": "AA+",
        "PlayCount": 1,
        "ClearCount": 1,
        "MaxCombo": 436,
        "LastPlayed": "2018-11-20T11:46:37Z",
        "SongId": "QIDd80o0OqobODP00ldQ1D9dl81qQi0d",
        "Mode": "SINGLE",
        "Difficulty": "EXPERT",
        "PlayerCode": 12312322
    },
  ...
]

GET /ddr/songs/scores/{id: song_id}

List of users scores for given song.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
  "order_by":
  [
    "mode",
    "difficulty DESC",
    "lamp ASC"
  ] OPTIONAL ❌
}

response

{
  "song_id": "{{song_id}}",
  "top_scores":
  [
    {
      "mode": "{{mode}}",
      "difficulty": "{{difficulty}}",
      "best_score": {{highscore}},
      "lamp": "{{lamp}}",
      "rank": "{{rank}}",
      "playcount": {{playcount}},
      "clearcount": {{clearcount}},
      "maxcombo": {{maxcombo}},
      "last_played": {{last_played}}
    },
    {
      "mode": "{{mode}}",
      "difficulty": "{{difficulty}}",
      "best_score": {{highscore}},
      "lamp": "{{lamp}}",
      "rank": "{{rank}}",
      "playcount": {{playcount}},
      "clearcount": {{clearcount}},
      "maxcombo": {{maxcombo}},
      "last_played": {{last_played}}
    },
    ...
  ],
  "modes": 
  [
    {
      "mode": "{{mode}}",
      "difficulties":
      [
        {
          "difficulty": "{{difficulty}}",
          "scores": 
          [
            {
              "score": {{score}},
              "clear_status": {{cleared}},
              "time_played": {{time_played}},
            },
            ...
          ]
        },
        ...
      ]
    },
    ...
  ]
}

GET /ddr/songs/scores/{id: song_id}/{mode: mode_name}/{difficulty: difficulty_name}

List of users scores for a given song difficulty.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
  "order_by": "time_played" OPTIONAL
}

response

{
  "song_id": "a1b2c3d4e5f6",
  "mode": "SINGLE",
  "difficulty": "EXPERT",
  "best_score": 
  {
    "best_score": 1000000,
    "lamp": "---",
    "rank": "AAA",
    "playcount": 3,
    "clearcount": 1,
    "maxcombo": 573,
    "last_played": 1234567890
  },
  "scores": 
  [
    {
      "score": 1000000,
      "clear_status": true,
      "time_played": 1234567890,
    },
    ...
  ]
}

User endpoints: /user

GET /user/login

Eagate login status for current authenticated user.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
}

response

{
  "Name": "[email protected]",
  "NickName": "BstUser",
  "Cookie": "cookie",
  "Expiration": 1234567890,
  "WebUser":  "myusername@bst_web.com"
}

{
  "error": "an error message"
}

POST /user/login

Link bst web user to eagate user.

headers

    "Authorization": "Bearer {{bearer_token}}"

payload

{
	"username": "[email protected]",
	"password": "MyPassword1!",
	"otp": "012345" OPTIONAL ❌
}

response

{
  "status": "ok"
}

{
  "error": "an error message"
}