-
Notifications
You must be signed in to change notification settings - Fork 10
PatchSoundModify
Robin B edited this page Mar 13, 2020
·
1 revision
Modify an existing sound on the website.
Key | Value |
---|---|
Content-Type | application/x-www-form-urlencoded |
Authorization | Configured admin token |
Key | Description | Format | Example |
---|---|---|---|
id | Target sound ID | Integer | 42 |
filename | New filename | String | explosion |
displayname | New displayname | String | Boom! |
source | New source | String | Movie 1 |
count | New count | Integer | 5000 |
theme | New theme | String | darkness |
All parameters are optional, but at least any one besides the ID must be provided. Parameters that are not provided will remain unchanged.
Key | Description | Format | Example |
---|---|---|---|
--- | ----------- | ------ | ------- |
/admin/sounds/modify
with:
- id
42
- filename
explosion
- displayname
Boom!
- source
Movie 1
- theme
darkness
Output when there is no error:
{
"code": 200,
"message": "Sound successfully modified.",
"sound": {
"id": 60,
"filename": "explosion",
"displayname": "Boom!",
"source": "Movie 1",
"count": 0,
"theme": "darkness"
}
}
Output when the requested sound (ID) was not found:
{
"code": 404,
"name": "Invalid sound",
"message": "Sound not found."
}
Output when count is provided but not of integer type:
{
"code": 400,
"name": "Invalid count",
"message": "Sound click count must be an integer if provided."
}
Output when no property to modify is provided:
{
"code": 400,
"name": "Invalid parameters",
"message": "At least one property to modify must be provided."
}
Output when filename is provided as empty strings:
{
"code": 400,
"name": "Invalid filename",
"message": "Sound filename may not be an empty string."
}
Output for misc. errors:
{
"code": 500,
"name": "Serverside error",
"message": "An unexpected error occurred."
}