import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.calls.record(
    call_uuid='3a2e4c90-dcee-4931-8a59-f123ab507e60', )
print(response)
{
  "url": "http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3",
  "message": "call recording started",
  "recording_id": "48dfaf60-3b2a-11e3",
  "api_id": "c7b69074-58be-11e1-86da-adf28403fe48"
}

This endpoint lets you start recording a call.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/Call/{call_uuid}/Record/

Arguments

ParameterTypeDescription
time_limitintegerSets the maximum duration, in seconds, of the recording.
Default: 60
file_formatstringThe file format for the recording.
Allowed values: mp3, wav
Default: mp3
transcription_typestringauto: Transcription is automated; the turnaround time is under 5 minutes and increases with call duration.
Transcription charges and details are available on the pricing page.
transcription_urlstringThe URL to which the transcription should be posted.
Note: Transcription information is sent via HTTP POST callback.
callback_urlstringThe URL invoked when the recording ends. Details sent to this URL are documented in the Callback URL section.
callback_methodstringThe HTTP verb used to invoke the callback_url.
Allowed values: GET, POST
Default: POST
record_channel_typestringSpecifies the recording channel type.
Allowed values: mono, stereo
Default: mono

Transcription is available only in English and limited to calls with duration >500ms and <4 hours, and file size <2GB.

The transcription information is sent to this URL via an HTTP POST callback.

Callback URL

These details are posted when the callback URL is invoked after the recording ends.

List of parameters sent to the callback URL

ParameterTypeDescription
api_idstringThe API ID that was returned by the Record API.
record_urlstringThe URL where the recorded file can be accessed.
call_uuidstringThe call_uuid of the call on which this recording was made.
recording_idstringThe recording_id returned by the Record API.
recording_durationintegerThe recording duration in seconds.
recording_duration_msintegerThe recording duration in milliseconds.
recording_start_msintegerThe start time of the recording since epoch in milliseconds.
recording_end_msintegerThe end time of the recording since epoch in milliseconds.

List of parameters sent to the transcription URL

ParameterTypeDescription
transcription_chargenumberThe credit deducted for the transcription.
transcriptionstringThe transcribed text of the recording.
durationintegerThe duration in seconds of the recording.
call_uuidstringThe call UUID of the call that was transcribed.
transcription_ratenumberThe rate of the transcription per minute.
recording_idstringThe recording ID of the transcribed recording.
errorstringMay be Recording duration too long for transcription or Recording file size too large for transcription. Empty if transcription is successful.

.mp3 files are smaller in size than .wav files. Consider changing the recording file format to .mp3 if you see this error.

Returns

If successful, this endpoint returns an acknowledgement that the recording has started along with a URL to access the recording.

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.calls.record(
    call_uuid='3a2e4c90-dcee-4931-8a59-f123ab507e60', )
print(response)
{
  "url": "http://s3.amazonaws.com/recordings_2013/48dfaf60-3b2a-11e3.mp3",
  "message": "call recording started",
  "recording_id": "48dfaf60-3b2a-11e3",
  "api_id": "c7b69074-58be-11e1-86da-adf28403fe48"
}