-
Notifications
You must be signed in to change notification settings - Fork 6
UploadSongAudio
Walter Lara edited this page Jun 13, 2022
·
5 revisions
Allows to request uploading a song's audio file.
URL: /v1/songs/{songId}/upload
Method: POST
Path Parameters:
| Parameter | Type | Description |
|---|---|---|
| songId | string | UUID of the Song to upload audio file. |
Query Parameters: None
Headers:
Authorization: Bearer {accessToken}
Content-Type: application/json
Content:
| Field | Type | Description | Requirement Type |
|---|---|---|---|
| fileName | string | Audio file name. | Required |
Content example:
{
"fileName": "blinding_lights.m4a"
}Code: 200 OK
Headers:
Content-Type: application/json
Content:
| Field | Type | Description | Condition |
|---|---|---|---|
| uploadUrl | string | URL to upload the audio file. | Always |
Content example:
{
"uploadUrl": "https://www.example.com/blinding_lights.m4a?signature=12345678"
}Code: 401 UNAUTHORIZED
Condition: If {accessToken} is invalid or expired.
Code: 403 FORBIDDEN
Condition: If the requestor is not the Song owner.
Headers:
Content-Type: application/json
Content example:
{
"code": 403,
"description": "Forbidden",
"cause": "operation allowed only by owner"
}Code: 404 NOT FOUND
Condition: If the specified Song is not found.
Headers:
Content-Type: application/json
Content example:
{
"code": 404,
"description": "Not Found",
"cause": "Entity SongEntity, id=d0907e3d-a9a7-43b1-93dc-f3b0ee929021 not found in the database"
}Code: 422 UNPROCESSABLE ENTITY
Condition: If {songId} is malformed.
Headers:
Content-Type: application/json
Content example:
{
"code": 422,
"description": "Unprocessable Entity",
"cause": "Invalid UUID string: 123456789"
}