-
Notifications
You must be signed in to change notification settings - Fork 4
UploadSongAudio
Allows uploading the Song audio file.
URL: /v1/songs/{songId}/audio
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:
Audio file binary content
Code: 200 OK
Headers:
Content-Type: application/json
Content:
Field | Type | Description | Condition |
---|---|---|---|
url | string | URL of the uploaded audio file. | Always |
mimeType | string | The detected MIME type of the uploaded audio file. | Always |
fileSize | integer | The size in bytes of the uploaded audio file. | Always |
duration | integer | The duration in seconds of the uploaded audio file. | Always |
sampleRate | integer | The sample rate in Hz of the uploaded audio file. | Always |
Content example:
{
"url": "s3://newm-audio/e377f5f9-4265-4af0-8636-1348fce7e693/audio.aiff",
"mimeType": "audio/x-aiff",
"fileSize": 5319693,
"duration": 133,
"sampleRate": 44100
}
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 the audio file doesnt meet any of the requirememts for file size, supported MIME type, duration or sample rate.
Headers:
Content-Type: application/json
Content example:
{
"code": 422,
"description": "Unprocessable Entity",
"cause": "Duration is too short: 25 secs"
}