Knowlege base

POST Recording

Article ID: 983
Last updated: 19 Mar, 2024

Upload a recording audio file coming from any external source.

Mono/Stereo recordings upload

If the source recording audio file is Stereo, then you can keep the same format within Imagicle Call Recording by applying the following setting, accessible only through a RDP session to the Imagicle on-prem instance. In case of an Imagicle UCX Cloud Suite, please contact Imagicle Support for help.

Procedure

  • Locate and edit the following file: \StonevoiceAS\Apps\Recorder\Settings\Recorder.defaults
  • Add this line: EnableSpeechAnalyticsOptimization=1
  • Save file and restart Imagicle Call Recording service

This setting is mostly important if you are leveraging Imagicle Voice Analytics application, to separate local/remote party call segments during transcription.

Resource URL

POST /fw/Apps/Recorder/WebAPI/Recordings

Resource Information

  • Request Content-Type: application/json
  • Request Content-Disposition: form-data; name=jsondata
  • Requires authentication: No

Request body

The request body is a multipart/form-data containing a part that describes the recording information and a part as the audio track attachment you want to import.
The supported audio formats are: PCM-16, A-Law, u-Law.
The maximum audio file size is 256 MBytes.

Recording metadata

Name Type Required Description Default Example
startDateTime  string  Yes  The recording start time (ISO 8601 format)  null  2018-09-25T13:00:00.0000000Z
duration  string  Yes  The recording duration (ISO 8601 format)  null  PT1M30S
direction  Direction  Yes  The recording direction (0, 1, 2)  null  1
localParty  Local Party  Yes  The recording local party info  null
remoteParty  Remote Party  No  The recording remote party info  null
pbxCallId  string  No  The PBX call ID   null  100
notes  string  No  The recording notes (the annotator is the user that invokes the API)  null  Some notes
preserved  bool  No  True if recording must be preserved (the preserver is the user that invoke the API)  false  true

Local party

Name Type Required Description Default Example
username  string  Yes  The local party username  null  mario_rossi
phoneNumber  string  Yes  The local party phone number  null  346

Remote party

Name Type Required Description Default Example
phoneNumber  string  No  The remote party phone number  null  3409876567

Direction

Value Description
0 The direction of the recorded call was unknown
1 The recorded call was incoming
2 The recorded call was outgoing

Responses

HTTP 201 Created

  • Returns the ID of the imported recording

Error response

HTTP 400 Bad request

  • Given recording data are not valid

 reason The reason why the request has been rejected
 message A human readable message

Reasons

Name Value Description
InvalidData 0 Body is null or cannot be parsed
 InvalidRecordingMetadata 1 Given recording metadata are not valid (more details are specified in message field)
 InvalidRecordingAudioFile 2 Given recording audio track is not valid

HTTP 401 Unauthorized

  • Anonymous requesting user
  • Wrong credentials

HTTP 403 Forbidden

  • The user has not enough privileges

HTTP 409 Conflict

  • The recording start date is out of the retention period

HTTP 500 Internal Server Error

  • An internal server error occurs while importing the recording

HTTP 501 Not Implemented

  • Call Recording license is not valid

Examples

POST    http://<IPAddress>/fw/Apps/Recorder/WebAPI/Recordings

Request body

--8d0d51ed-3539-48fa-a239-fb4ee91b3b99
Content-Type: multipart/form-data
Content-Disposition: form-data; name=jsondata

{
    "direction":  2,
    "localParty":  {
                       "phoneNumber":  "376",
                       "username":  "giuliano"
                   },
    "pbxCallId":  "1",
    "preserved":  true,
    "duration":  "PT1M30S",
    "notes":  "text describing recording content",
    "startDateTime":  "2018-09-25T13:00:00.0000000Z",
    "remoteParty":  {
                        "phoneNumber":  "123456"
                    }
}
--8d0d51ed-3539-48fa-a239-fb4ee91b3b99
Content-Type: audio/mpeg
Content-Disposition: form-data; name=attachment; filename=sample.wav; filename*=utf-8''sample.wav

audio track bytes  
--8d0d51ed-3539-48fa-a239-fb4ee91b3b99--

Response

{"id":"f20850dd-6074-4c9f-8973-24381962ac6f"}
Article ID: 983
Last updated: 19 Mar, 2024
Revision: 3
Views: 111
Print Export to PDF Subscribe Share
Prev   Next
Get Active Recordings     User Guides