Start Recording a Multiparty Call

    This endpoint starts recording a Multiparty Call.

    API Endpoint

    POST https://api.plivo.com/v1/Account/{auth_id}/MultiPartyCall/name_{mpc_name}/Record/

    Arguments

    file_format

    Format of the recording.

    • Allowed values: mp3, wav.
    • Defaults to mp3.
    recording_callback_urlURL to which status update events for this recording should be posted.
    recording_callback_method

    HTTP verb used to invoke the URL configured as status_callback_url.

    • Allowed values: GET, POST.
    • Defaults to POST.
    Note: A Supervisor’s voice will be recorded regardless of the coach_mode setting.

    List of events and parameters sent to the recording_callback_url

    These events are generated:

    • MPCRecordingInitiated
    • MPCRecordingPaused
    • MPCRecordingResumed
    • MPCRecordingCompleted
    • MPCRecordingFailed

    This information is sent to the URL when an event is triggered:

    EventNamestringEvent that triggered this notification. This parameter will have one of the values from the list of events above.
    EventTimestampstringTimestamp at which the event occurred.

    Format: YYYY-MM-DD HH:mm:ss+|-hh:mm

    MPCNamestringFriendly name provided during the creation of the MPC.
    MPCUUIDstringUnique ID of the Multiparty call.
    RecordingDurationstringDuration of recording in seconds.
    RecordingEndTimestringTimestamp at which the recording ended.

    Format: YYYY-MM-DD HH:mm:ss+|-hh:mm

    RecordingFormatstringFormat of the recording.
    RecordingResourceURLstringResource URL of the recording file. You can use this URL to fetch the recording details later.
    RecordingStartTimestringTimestamp at which the recording started.

    Format: YYYY-MM-DD HH:mm:ss+|-hh:mm

    RecordingURLstringComplete path to the recorded file URL.
    RecordingUUIDstringUnique identifier to identify the file.
    SequenceNumberstringIndicates the sequence of the callback. Helpful to sort the callback events posted to the recording_callback_url.

    Returns

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

    Response

    {
      "api_id": "e05b5263-45dc-11eb-9014-0242ac110003",
      "message": "MPC: test_mpc_1 record started",
      "recording_id": "e06ac332-45dc-11eb-94fe-06dd7f581a50",
      "recording_url": "https://media.plivo.com/v1/Account/MAOTE1OWE0MDK0MTLHYW/Recording/e06ac332-45dc-11eb-94fe-06dd7f581a50.mp3"
    }
    

    Example Request

    1
    2
    3
    4
    5
    6
    
    import plivo
    
    client = plivo.RestClient(auth_id="your_auth_id", auth_token="your_auth_token")
    
    response = client.multi_party_calls.start_recording(friendly_name='mpc_name', file_format='wav', status_callback_url='https://plivo.com/status')
    print(response)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    require "rubygems"
    require "/root/plivo-ruby/lib/plivo.rb"
    include Plivo
    include Plivo::Exceptions
    
    api = RestClient.new("<auth_id>","<auth_token>")
    begin
      response = api.multipartycalls.start_recording("friendly_name":"mpc_name")
      puts response
    rescue PlivoRESTError => e
      puts 'Exception: ' + e.message
    end
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    var plivo = require('plivo');
    
    (function main() {
        'use strict';
    
        var client = new plivo.Client("<auth_id>","<auth_token>");
        client.multiPartyCalls.startRecording(
            {
                'file_format':'wav',
                'status_callback_url':'https://plivo.com/status'
                
            }, 
            'mpc_name').then(function (response) {
            console.log(response);
        }, function (err) {
            console.error(err);
        });
    })();
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    <?php
    require 'vendor/autoload.php';
    
    use Plivo\RestClient;
    use Plivo\Exceptions\PlivoRestException;
    
    $client = new RestClient("<auth_id>", "<auth_token>");
    try
    {
        $response = $client
            ->multiPartyCalls
            ->startRecording(["friendly_name" => "mpc_name", ]);
        print_r($response);
    }
    catch(PlivoRestException $ex)
    {
        print_r($ex);
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    
    package com.plivo.examples.multipartycall;
    
    import com.plivo.api.Plivo;
    import com.plivo.api.exceptions.PlivoRestException;
    import com.plivo.api.exceptions.PlivoValidationException;
    import com.plivo.api.models.multipartycall.MultiPartyCall;
    import com.plivo.api.models.multipartycall.MultiPartyCallRecordingStart;
    import com.plivo.api.models.multipartycall.MultiPartyCallRecordingStartResponse;
    import com.plivo.api.models.multipartycall.MultiPartyCallUtils;
    
    import java.io.IOException;
    
    public class StartMPCRecording {
    
      public static void main(String[] args) throws IOException, PlivoRestException, PlivoValidationException {
        Plivo.init("<YOUR-AUTH-ID>", "<YOUR-AUTH-TOKEN>");
        try{
          MultiPartyCallRecordingStart recordingStart1 = MultiPartyCall.recordStarter(MultiPartyCallUtils.friendlyName("myMPC1"));
          MultiPartyCallRecordingStartResponse resp1 = recordingStart1.fileFormat("wav").statusCallbackUrl("http://status/recording/").update();
          System.out.println(resp1.getRecordingUrl());
          System.out.println(resp1.getRecordingId());
        }
        catch (Exception e)
        {
          e.printStackTrace();
        }
      }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    
    using System;
    using Plivo;
    using Plivo.Exception;
    
    namespace PlivoExamples
    {
        class Program
        {
            static void Main(string[] args)
            {
                var api = new PlivoApi("<auth_id>", "<auth_token>");
    
                try
                {
                    var response = api.MultiPartyCall.StartRecording(friendlyName: "mpc_name");
                    Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                    Console.WriteLine("Exception: " + e.Message);
                }
    
            }
        }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/plivo/plivo-go"
    )
    
    func main() {
    	client, err := plivo.NewClient("<auth_id>", "<auth_token>", &plivo.ClientOptions{})
    	if err != nil {
    		panic(err)
    	}
    	response, err := client.MultiPartyCall.StartRecording(plivo.MultiPartyCallBasicParams{FriendlyName: "MPC_Name"}, plivo.MultiPartyCallStartRecordingParams{FileFormat: "", StatusCallbackUrl: ""})
    	if err != nil {
    		panic(err)
    	}
    	fmt.Printf("Response: %#v\n", response)
    
    }