Endpoint: POST /
Description: Uploads a new recording. The request must be sent as multipart/form-data containing:
-
A JSON part (
jsondata) with the recording metadata. -
A binary part (
attachment) with the audio file.
Request Body:
-
Content Type:
multipart/form-data -
Parts:
-
jsondata:
-
Must have a
Content-Typeofapplication/json. -
Follows the UploadRecordingMetadata schema, including fields such as:
-
startDateTime: Start time of the recording (ISO-8601 format). -
duration: Duration of the recording (ISO-8601 duration format). -
direction: Direction (0, 1, or 2). -
localParty: An object withusernameandphoneNumber. -
Optional fields such as
remoteParty,notes,preserved, andpbxInfo.
-
-
-
(WAVE) attachment:
-
Must have a Content-Type, supported ones below:
-
audio/wave
-
audio/vnd.wav
-
audio/vnd.wave
-
audio/wav
-
audio/x-pn-wav
-
audio/x-wav
-
-
Must contain the binary audio file.
-
Supported Formats:
-
audio/wave(WAV - PCM-8, PCM-16, A-Law, u-Law)
-
-
Maximum File Size: 256 MB
-
-
(MP3) attachment:
-
Must have a Content-Type = audio/mpeg
-
Must contain the binary audio file.
-
Supported Formats:
-
audio/mpeg(MP3)
-
-
Maximum File Size: 256 MB
-
-
Examples:
Use a multipart/form-data request with two parts:
-
A JSON part (
jsondata) containing the metadata. -
A binary part (
attachment) with the audio file.
Responses:
-
201 Created: Returns the ID of the newly created recording as a JSON object.
-
400 Bad Request: If parameters are invalid. The error response includes:
-
reason(integer): Codes such as:-
0: Request body is null or unparseable. -
1: Recording metadata is invalid. -
2: Audio file is invalid.
-
-
message(string): Detailed error description.
-
-
Additional Error Codes:
401,403,409(if the recording start date is out of the retention period),500,501(if the Imagicle Call Recording license is invalid), and504.