INFO
5beam 2023 summer update

There has been some major changes:


INFO Everything

  • The amount parameter has been removed from all endpoints

STRUCT Level

  • createdAt is now created
  • modded has been added
  • updated has been added (although users cannot edit levels yet)
  • creatorId has been removed
  • levelpackId has been removed
  • levelpackPart has been removed

STRUCT Levelpack

  • The maximum amount of levels in a levelpack is 100
  • plays has been added
  • stars has been added
  • modded has been added
  • updated has been added (although users cannot edit levelpacks yet)
  • By default, levels will now have a list of level ID's. But you can use the levels parameter to change it back to how it was before.
  • creatorId has been removed
  • createdAt is now created

STRUCT User

  • creatorId is now id
  • createdAt is now created
  • name is now username
  • updated has been added
  • levelpacks has been added. It's an array of levelpacks ID's the user has made.
  • levels has been added. It's an array of level ID's the user has made.
  • stars has been added. It's an array of level ID's the user has starred. (although for now this feature is WIP)

GET
api/ page

  • Type and sort codes have changed.
  • New featured property.

GET
api/ user/ page

  • creatorId is now id
  • Type and sort codes have changed.
  • New featured property.

GET
api/ search

  • Search results may be different because of the move to another database.

GET
api/ auth/ discord

  • No changes, but it's now in the API docs

POST
api/ auth/ refresh

  • New!
INFO
Supported Mods
  • Mawilite's 5*30

Contact

DISCORD
zelo101
if you'd like to have your 5b mod supported!

STRUCT
Level
{
  "created": "2023-08-02 20:00:29.848Z",
  "creator": {
    "created": "2023-08-02 19:58:58.849Z",
    "discordId": "1032069168419319849",
    "id": "bo4wdr6syac901u",
    "levels": [
      "h2o60d2dqklmwdz"
    ],
    "stars": [],
    "updated": "2023-08-02 20:00:29.916Z",
    "username": "orangemario2009"
  },
  "data": "(levels.txt)",
  "description": "\"I want revenge!\"",
  "difficulty": 0,
  "featured": false,
  "id": "h2o60d2dqklmwdz",
  "title": "Ice Cube's Revenge!",
  "updated": "2023-08-02 20:00:29.848Z",
  "plays": 0,
  "unlisted": false
}
            
STRUCT
Levelpack
{
  "created": "2023-08-03 19:19:00.152Z",
  "creator": {
    "created": "2023-08-02 19:58:48.051Z",
    "discordId": "189004032600309760",
    "id": "3hfbpvnkpywte1k",
    "levelpacks": [
      "98doig139d2su27"
    ],
    "levels": [
      "mo4ze2nvbkvtsay",
      "8pjwict2l5b0v59",
      "4ljvua2t3n9zqvl"
    ],
    "stars": [],
    "updated": "2023-08-04 00:09:38.473Z",
    "username": "Zinc_Battery"
  },
  "description": "that i found in the database",
  "featured": false,
  "id": "98doig139d2su27",
  "levels": [
    "h2o60d2dqklmwdz",
    "7xh421meonyk67m",
    "52mlfgyz3w7szx4",
    "3i0pci3vqcy4t6z",
    "iu59zjjufi13487",
    "a28ei1gdvw2xtlw",
    "2bg7b6tbvdp2lub",
    "07g36jbp9j30s2w",
    "d6w28252kp0mpcy",
    "36mqgcgv30w2jb3",
    "b8daes3u6xoew8l",
    "n41zswfvn909cgb",
    "6mms3g04oy6ijqk",
    "i9scxz43qe96o4v",
    "ertlv22sxa75v23"
  ],
  "stars": 0,
  "title": "random levels",
  "updated": "2023-08-03 19:19:00.152Z",
  "plays": 0
}
            
STRUCT
User
{
  "created": "2023-08-02 19:58:58.929Z",
  "discordId": "1128443643221508187",
  "id": "buve7iifzkz8kzz",
  "levels": [
    "oayu8nm22wg3qyj",
    "986ycm3dw75g00t"
  ],
  "stars": [],
  "updated": "2023-08-02 20:00:30.089Z",
  "username": "ue"
}
            

There is a parameter in most endpoints that let you expand the levels property to actually include the levels.

GET
api/ level
Parameters
NameDescriptionTypeDefaults
idLevel IDINTEGER

Returns a

STRUCT Level
.

GET
api/ levelpack
Parameters
NameDescriptionTypeDefaults
idLevelpack IDINTEGER
levelsInclude LevelsINTEGER0

Level codes:

Level Codes
CodeMeaning
0Return Level ID's
1Return STRUCT Levels (can be slow)

Returns a

STRUCT Levelpack

GET
api/ user
Parameters
NameDescriptionTypeDefaults
idUser IDSTRING
discordIdUser's Discord IDSTRING

Returns a

STRUCT User
.

You can use either "id" or "discordId", but if you use both, only "id" will be used.

GET
api/ page
Parameters
NameDescriptionTypeDefaults
pagePage numberINTEGER
typeType ofINTEGER0
sortSort byINTEGER0
featuredOnly featured levels / levelpacksBOOLEANfalse
modOnly show levels / levelpacks that are for a specific 5b modSTRING

Returns a list of

STRUCT Level
.

Type codes:

Type Codes
CodeMeaning
0Levels
1Levelpacks

Sort codes:

Sort Codes
CodeMeaning
0Age (newest)
1Age (oldest)
2Plays (descending)
GET
api/ search
Parameters
NameDescriptionTypeDefaults
textSearch textSTRING
pagePage numberINTEGER
modOnly show levels that are for a specific 5b modSTRING

Returns a list of

STRUCT Level
who's title contains the search text. Levelpacks are not supported in search yet.

GET
api/ user/ page
Parameters
NameDescriptionTypeDefaults
idUser IDINTEGER
pagePage numberINTEGER
typeType ofINTEGER0
sortSort byINTEGER0
modOnly show levels / levelpacks that are for a specific 5b modSTRING

Returns a list of

STRUCT Level
created by the user.

Type codes:

Type Codes
CodeMeaning
0Levels
1Levelpacks

Sort codes:

Filter Codes
CodeMeaning
0Age (newest)
1Age (oldest)
2Plays (descending)
POST
api/ create/ level
user token required

For now, this endpoint can only be used on HTML5b's site.

Create a

STRUCT Level
. Make sure access_token is valid before posting! You will need to give 5beam the following using a FormData object:

PropertyMeaningType
access_tokenUser's discord access token.STRING
titleLevel titleSTRING
descriptionLevel descriptionSTRING
dataLevel fileFile
moddedWhat mod this level is for (Leave blank for HTML5b / Flash 5b)STRING
POST
api/ create/ levelpack
user token required

For now, this endpoint can only be used on HTML5b's site.

Create a

STRUCT Levelpack
. Make sure access_token is valid before posting! You will need to give 5beam the following using a FormData object:

PropertyMeaningType
access_tokenUser's discord access token.STRING
titleLevelpack titleSTRING
descriptionLevelpack descriptionSTRING
dataLevelpack fileFile
moddedWhat mod this levelpack is for (Leave blank for HTML5b / Flash 5b)STRING
GET
api/ auth/ discord

For now, this endpoint can only be used on HTML5b's site.

Endpoint for logging into 5beam discord oauth, returns an access & refresh token.

POST
api/ auth/ refresh
user token required

For now, this endpoint can only be used on HTML5b's site.

Gives you a new access_token. If this returns 400, it means your refresh_token is bad and you'll have to login again.

PropertyMeaningType
refresh_tokenUser's discord refresh token.STRING