-
Notifications
You must be signed in to change notification settings - Fork 10
PostSoundUpload
Robin B edited this page Mar 13, 2020
·
1 revision
Upload a new sound to the website.
Key | Value |
---|---|
Content-Type | application/x-www-form-urlencoded |
Authorization | Configured admin token |
Key | Description | Type | Example |
---|---|---|---|
file | Sound file (mp3) that contains the sound to be played | File | -------- |
filename | Filename the sound file should be saved under | Text | laugh |
displayname* | Name the sound should be displayed under on the website | Text | hahaha |
source* | Origin of the soundclip (i.e. Season, OVA, Movie, etc) | Text | Season 2 |
count* | Preset count of the sound (defaults to 0) | Integer | 5000 |
theme* | Theme for the soundclip (defaults to "megumin") | Text | goddess |
* Optional parameter
Info: While source and displayname are optional, if either is not provided, they won't show up on the soundboard or rankings (but be included on the main page button).
Key | Description | Format | Example |
---|---|---|---|
--- | ----------- | ------ | ------- |
/admin/sounds/upload
with:
- file
test.mp3
- filename
laugh
- displayname
hahaha
- source
Season 2
- count
null
- theme
null
(no theme defaults tomegumin
, the base sounds)
Output when there is no error:
{
"code": 200,
"message": "Sound successfully uploaded.",
"sound": {
"id": 42,
"filename": "laugh",
"displayname": "hahaha",
"source": "Season 2",
"count": 0,
"theme": "megumin"
}
}
Output when filename is already in use:
{
"code": 400,
"name": "Invalid filename",
"message": "Sound filename already in use."
}
Output when no filename is provided:
{
"code": 400,
"name": "Invalid filename",
"message": "Filename must be provided."
}
Output when either no file or a non-mp3 file is provided:
{
"code": 400,
"name": "Invalid file",
"message": "An mp3 file must be provided."
}
Output when count is provided but not of integer type:
{
"code": 400,
"name": "Invalid count",
"message": "Count must be an integer if provided."
}
Output for other errors:
{
"code": 500,
"name": "Serverside error",
"message": "An unexpected error occurred."
}