class Bandwidth::Recording

Retrieve call recordings,

Public Class Methods

get(client, id) click to toggle source

Retrieve a specific call recording information, identified by recordingId @param client [Client] optional client instance to make requests @param id [String] id of recording @return [Hash] recording information @example

recording = Recording.get(client, "id")
# File lib/bandwidth/recording.rb, line 15
def self.get(client, id)
  item = client.make_request(:get, client.concat_user_path("#{RECORDING_PATH}/#{id}"))[0]
  Recording.new(item, client)
end
list(client, query = nil) click to toggle source

List a user's call recordings @param client [Client] optional client instance to make requests @param query [Hash] query options @return [Array] list of recordings @example

recordings = Recording.list(client)
# File lib/bandwidth/recording.rb, line 27
def self.list(client, query = nil)
  client.make_request(:get, client.concat_user_path(RECORDING_PATH), query)[0].map do |item|
    Recording.new(item, client)
  end
end

Public Instance Methods

create_transcription() click to toggle source

Request the transcription process to be started for the given recording id. @return [Hash] created transcription @example

transcription = recording.create_transcription()
# File lib/bandwidth/recording.rb, line 38
def create_transcription()
  headers = @client.make_request(:post, @client.concat_user_path("#{RECORDING_PATH}/#{id}/transcriptions"), {})[1]
  id = Client.get_id_from_location_header(headers[:location])
  get_transcription(id)
end
get_transcription(transcription_id) click to toggle source

Gets information about a transcription @param transcription_id [String] id of transcription @return [Hash] event data @example

transcription  = recording.get_transcription("id")
# File lib/bandwidth/recording.rb, line 49
def get_transcription(transcription_id)
  @client.make_request(:get, @client.concat_user_path("#{RECORDING_PATH}/#{id}/transcriptions/#{transcription_id}"))[0]
end
get_transcriptions() click to toggle source

Gets the list of transcriptions for a recording @return [Array] list of events @example

transcriptions = recording.get_transcriptions()
# File lib/bandwidth/recording.rb, line 57
def get_transcriptions()
  @client.make_request(:get, @client.concat_user_path("#{RECORDING_PATH}/#{id}/transcriptions"))[0]
end