Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Call Recording Resource

A Call Recording resource represents the recording associated with a voice call, conference, or SIP Trunk. Using the Call Recordings REST API, you can fetch, start, stop, pause, resume, and delete voice recordings.

These are some ways to start a recording for a call, conference, or trunk.

  1. Enable recording in TwiML using one of these verbs:
    1. <Record>
    2. <Dial record>
    3. <Conference record>
  2. Set Record=true in an outbound call initiated by the REST API
  3. Enable recording on an elastic SIP Trunk in the Twilio Console
  4. Post to the Call Recording resource of a call in progress

Call Recording properties

Names in C# format
AccountSid
sid<AC> Not PII

The SID of the Account that created the Recording resource.

ApiVersion
文字列 Not PII

The API version used to make the recording.

CallSid
sid<CA> Not PII

The SID of the Call the Recording resource is associated with.

ConferenceSid
sid<CF> Not PII

The Conference SID that identifies the conference associated with the recording, if a conference recording.

DateCreated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was created specified in RFC 2822 format.

DateUpdated
date_time<rfc2822> Not PII

The date and time in GMT that the resource was last updated, specified in RFC 2822 format.

StartTime
date_time<rfc2822> Not PII

The start time of the recording in GMT and in RFC 2822 format.

Duration
文字列 Not PII

The length of the recording in seconds.

Sid
sid<RE> Not PII

The unique string that that we created to identify the Recording resource.

Price
decimal Not PII

The one-time cost of creating the recording in the price_unit currency.

Uri
uri Not PII

The URI of the resource, relative to https://api.twilio.com.

EncryptionDetails
オブジェクト Not PII

How to decrypt the recording if it was encrypted using Call Recording Encryption feature.

PriceUnit
currency Not PII

The currency used in the price property. Example: USD.

Status
enum:status Not PII

The status of the recording. Can be: processing, completed and absent. For more detailed statuses on in-progress recordings, check out how to Update a Recording Resource.

Channels
integer Not PII

The number of channels in the final recording file. Can be: 1, or 2. Separating a two leg call into two separate channels of the recording file is supported in Dial and Outbound Rest API record options.

Source
enum:source Not PII

How the recording was created. Can be: DialVerb, Conference, OutboundAPI, Trunking, RecordVerb, StartCallRecordingAPI, and StartConferenceRecordingAPI.

ErrorCode
integer? Not PII

The error code that describes why the recording is absent. The error code is described in our Error Dictionary. This value is null if the recording status is not absent.

Create a Call Recording resource

post
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json

Starts a recording on the call identified by {CallSid}.

パラメーター
Names in None format
recording_status_callback_event
オプション
post string[] Not PII

The recording status events on which we should call the recording_status_callback URL. Can be: in-progress, completed and absent and the default is completed. Separate multiple event values with a space.

recording_status_callback
オプション
post url Not PII

The URL we should call using the recording_status_callback_method on each recording event specified in recording_status_callback_event. For more information, see RecordingStatusCallback parameters.

recording_status_callback_method
オプション
post http_method Not PII

The HTTP method we should use to call recording_status_callback. Can be: GET or POST and the default is POST.

trim
オプション
post 文字列 Not PII

Whether to trim any leading and trailing silence in the recording. Can be: trim-silence or do-not-trim and the default is do-not-trim. trim-silence trims the silence from the beginning and end of the recording and do-not-trim does not.

recording_channels
オプション
post 文字列 Not PII

The number of channels used in the recording. Can be: mono or dual and the default is mono. mono records all parties of the call into one channel. dual records each party of a 2-party call into separate channels.

account_sid
必須
post sid<AC> Not PII

The SID of the Account that will create the resource.

call_sid
必須
post sid<CA> Not PII

The SID of the Call to associate the resource with.

例 1
        
        
        
        
        例 2
              
              
              
              

              Fetch a Call Recording resource

              GET
              https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json

              The default response to a Fetch call is a WAV file of the recording. Appending .json to the {Sid} returns a JSON representation of the response. See the response formats for more options.

              The URLs of the individual recordings are public and do not require HTTP Basic Auth to access. They are useful for many external applications such as embedding in a web application. By not requiring HTTP Basic Auth, they can be used in a web application without the need to reveal your Twilio API credentials.

              For added security, you can enforce HTTP basic auth to access media using your Account SID and Authentication token via the voice settings page in the console.

              Twilio's recording URLs are quite long and difficult to guess, however, so the contents of the recordings should be reasonably private unless you distribute the URL.

              パラメーター
              Names in None format
              account_sid
              必須
              GET sid<AC> Not PII

              The SID of the Account that created the Recording resource to fetch.

              call_sid
              必須
              GET sid<CA> Not PII

              The Call SID of the resource to fetch.

              sid
              必須
              GET sid<RE> Not PII

              The Twilio-provided string that uniquely identifies the Recording resource to fetch.

              例 1
                    
                    
                    
                    

                    Response formats

                    The file extension appended to the {Sid} determines the response format.

                    File extension Response type Mime type
                    (なし) WAV file audio/x-wav
                    .json JSON document application/json
                    .mp3 MP3 file audio/mpeg
                    .wav WAV file audio/x-wav
                    .xml XML document application/xml

                    JSON

                    Appending .json to the {Sid} returns a JSON representation of the resource's metadata, as shown in the example above.

                    MP3

                    Appending .mp3 to the {Sid} returns a binary MP3 audio file with mime-type type audio/mpeg. For example:

                    GET https://api.twilio.com/2010-04-01/Accounts/ACXXXXX.../Calls/CAXXXXX.../Recordings/RE557ce644e5ab84fa21cc21112e22c485.mp3
                    

                    The MP3 files have a bitrate of 32kbps.

                    WAV (default)

                    Without an extension, or by appending .wav to the {Sid}, a binary WAV audio file is returned with the mime-type audio/x-wav. For example:

                    GET https://api.twilio.com/2010-04-01/Accounts/ACXXXXX.../Calls/CAXXXXX.../Recordings/RE557ce644e5ab84fa21cc21112e22c485
                    

                    The WAV files have a bitrate of 128kbps.

                    XML

                    Appending .xml to the {Sid} returns an XML representation of the resource's metadata.

                    Fetch a Recording's transcription

                    Each Call Recording resource has a Transcription subresource that represents the transcriptions generated from the recording of the call, if any recordings were transcribed. For example:

                    GET https://api.twilio.com/2010-04-01/Accounts/{YourAccountSid}/Recordings/{RecordingSid}/Transcriptions

                    See the Recording Transcription resource documentation for more information.

                    Read multiple Call Recording resources

                    GET
                    https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings.json

                    Returns a list of Call Recording resources, each representing a recording generated during the call.

                    The reponse also includes paging information.

                    The list of Recordings is protected by your account credentials, so you must use HTTP Basic Auth to access the Call Recording resources.

                    パラメーター
                    Names in None format
                    account_sid
                    必須
                    GET sid<AC> Not PII

                    The SID of the Account that created the Recording resources to read.

                    call_sid
                    必須
                    GET sid<CA> Not PII

                    The Call SID of the resources to read.

                    date_created
                    オプション
                    GET date_inequality<iso8601> Not PII

                    The date_created value, specified as YYYY-MM-DD, of the resources to read. You can also specify inequality: DateCreated<=YYYY-MM-DD will return recordings generated at or before midnight on a given date, and DateCreated>=YYYY-MM-DD returns recordings generated at or after midnight on a date.

                    例 1
                          
                          
                          
                          
                          例 2
                                
                                
                                
                                
                                Only return recordings generated on Oct 18, 2016

                                Read multiple Call Recording resources from a specific date

                                Only return recordings generated on Oct 18, 2016
                                例 3
                                      
                                      
                                      
                                      
                                      Only return recordings generated between midnight Oct 12, 2016, and midnight Oct 15, 2016

                                      Read multiple Call Recording resources created within a specified date range

                                      Only return recordings generated between midnight Oct 12, 2016, and midnight Oct 15, 2016

                                      Update a Call Recording resource

                                      post
                                      https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json
                                      パラメーター
                                      Names in None format
                                      account_sid
                                      必須
                                      post sid<AC> Not PII

                                      The SID of the Account that created the Recording resource to update.

                                      call_sid
                                      必須
                                      post sid<CA> Not PII

                                      The Call SID of the resource to update.

                                      sid
                                      必須
                                      post sid_like<RE> Not PII

                                      The Twilio-provided string that uniquely identifies the Recording resource to update.

                                      status
                                      必須
                                      post enum:status Not PII

                                      The new status of the recording. Can be: stopped, paused, in-progress.

                                      pause_behavior
                                      オプション
                                      post 文字列 Not PII

                                      Whether to record during a pause. Can be: skip or silence and the default is silence. skip does not record during the pause period, while silence will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting status is set to paused.

                                      例 1
                                            
                                            
                                            
                                            

                                            Delete a Call Recording resource

                                            削除する
                                            https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls/{CallSid}/Recordings/{Sid}.json

                                            アカウントから録音を削除します。 録音が削除されると、その時間分占有していたストレージに対して請求されなくなります。

                                            If successful, DELETE returns HTTP 204 (No Content) with no body.

                                            パラメーター
                                            Names in None format
                                            account_sid
                                            必須
                                            削除する sid<AC> Not PII

                                            The SID of the Account that created the Recording resources to delete.

                                            call_sid
                                            必須
                                            削除する sid<CA> Not PII

                                            The Call SID of the resources to delete.

                                            sid
                                            必須
                                            削除する sid<RE> Not PII

                                            The Twilio-provided string that uniquely identifies the Recording resource to delete.

                                            例 1
                                                  
                                                  
                                                  
                                                  

                                                  RecordingStatusCallback parameters

                                                  We pass these parameters in the request to RecordingStatusCallback:

                                                  パラメーター 概要
                                                  AccountSid The SID of the Account responsible for this recording.
                                                  CallSid The SID of the call associated with the recording.
                                                  RecordingSid The SID of the recording.
                                                  RecordingUrl 録音された音声の URL。
                                                  RecordingStatus 録音ステータスです。 取りうる値はin-progresscompleted、およびabsentです。
                                                  RecordingDuration The length of the recording, in seconds when RecordingStatus is completed; otherwise, null.
                                                  RecordingChannels The number of channels in the final recording file. Can be: 1, 2.
                                                  RecordingStartTime The timestamp of when the recording started.
                                                  RecordingSource The initiation method used to create this recording. For recordings initiated with this API, the value will be StartCallRecordingAPI.
                                                  Rate this page:

                                                  ヘルプが必要ですか?

                                                  誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。