Sitelet https://github.com/Bandwidth/php-sdk/blob/main/docs/Api/RecordingsApi.md#updatecallrecordingstate
Skip to content

Latest commit

 

History

History
726 lines (523 loc) · 26.1 KB

RecordingsApi.md

File metadata and controls

726 lines (523 loc) · 26.1 KB

Bandwidth\RecordingsApi

All URIs are relative to http://localhost, except if the operation defines another base path.

Method HTTP request Description
deleteRecording() DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Delete Recording
deleteRecordingMedia() DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Delete Recording Media
deleteRecordingTranscription() DELETE /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Delete Transcription
downloadCallRecording() GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/media Download Recording
getCallRecording() GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId} Get Call Recording
getRecordingTranscription() GET /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Get Transcription
listAccountCallRecordings() GET /accounts/{accountId}/recordings Get Call Recordings
listCallRecordings() GET /accounts/{accountId}/calls/{callId}/recordings List Call Recordings
transcribeCallRecording() POST /accounts/{accountId}/calls/{callId}/recordings/{recordingId}/transcription Create Transcription Request
updateCallRecordingState() PUT /accounts/{accountId}/calls/{callId}/recording Update Recording

deleteRecording()

deleteRecording($account_id, $call_id, $recording_id)

URI(s):

Delete the recording information, media and transcription. Note: After the deletion is requested and a 204 is returned, neither the recording metadata nor the actual media nor its transcription will be accessible anymore. However, the media of the specified recording is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.

$hostIndex = 0;
$variables = [
];

try {
    $apiInstance->deleteRecording($account_id, $call_id, $recording_id, $hostIndex, $variables);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->deleteRecording: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

void (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteRecordingMedia()

deleteRecordingMedia($account_id, $call_id, $recording_id)

URI(s):

Deletes the specified recording's media.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.

$hostIndex = 0;
$variables = [
];

try {
    $apiInstance->deleteRecordingMedia($account_id, $call_id, $recording_id, $hostIndex, $variables);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->deleteRecordingMedia: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

void (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteRecordingTranscription()

deleteRecordingTranscription($account_id, $call_id, $recording_id)

URI(s):

Deletes the specified recording's transcription. Note: After the deletion is requested and a 204 is returned, the transcription will not be accessible anymore. However, it is not deleted immediately. This deletion process, while transparent and irreversible, can take an additional 24 to 48 hours.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.

$hostIndex = 0;
$variables = [
];

try {
    $apiInstance->deleteRecordingTranscription($account_id, $call_id, $recording_id, $hostIndex, $variables);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->deleteRecordingTranscription: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

void (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

downloadCallRecording()

downloadCallRecording($account_id, $call_id, $recording_id): \SplFileObject

URI(s):

Downloads the specified recording.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->downloadCallRecording($account_id, $call_id, $recording_id, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->downloadCallRecording: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\SplFileObject

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: audio/vnd.wave, audio/mpeg, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getCallRecording()

getCallRecording($account_id, $call_id, $recording_id): \Bandwidth\Model\CallRecordingMetadata

URI(s):

Returns metadata for the specified recording.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->getCallRecording($account_id, $call_id, $recording_id, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->getCallRecording: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\CallRecordingMetadata

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRecordingTranscription()

getRecordingTranscription($account_id, $call_id, $recording_id): \Bandwidth\Model\RecordingTranscriptions

URI(s):

Downloads the specified transcription. If the recording was multi-channel, then there will be 2 transcripts. The caller/called party transcript will be the first item while <PlayAudio> and <SpeakSentence> transcript will be the second item. During a <Transfer> the A-leg transcript will be the first item while the B-leg transcript will be the second item.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->getRecordingTranscription($account_id, $call_id, $recording_id, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->getRecordingTranscription: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\RecordingTranscriptions

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listAccountCallRecordings()

listAccountCallRecordings($account_id, $to, $from, $min_start_time, $max_start_time): \Bandwidth\Model\CallRecordingMetadata[]

URI(s):

Returns a list of metadata for the recordings associated with the specified account. The list can be filtered by the optional from, to, minStartTime, and maxStartTime arguments. The list is capped at 1000 entries and may be empty if no recordings match the specified criteria.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$to = %2b19195551234; // string | Filter results by the `to` field.
$from = %2b19195554321; // string | Filter results by the `from` field.
$min_start_time = 2022-06-21T19:13:21Z; // string | Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format).
$max_start_time = 2022-06-21T19:13:21Z; // string | Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format).

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->listAccountCallRecordings($account_id, $to, $from, $min_start_time, $max_start_time, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->listAccountCallRecordings: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
to string Filter results by the `to` field. [optional]
from string Filter results by the `from` field. [optional]
min_start_time string Filter results to recordings which have a `startTime` after or including `minStartTime` (in ISO8601 format). [optional]
max_start_time string Filter results to recordings which have a `startTime` before `maxStartTime` (in ISO8601 format). [optional]
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\CallRecordingMetadata[]

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listCallRecordings()

listCallRecordings($account_id, $call_id): \Bandwidth\Model\CallRecordingMetadata[]

URI(s):

Returns a (potentially empty) list of metadata for the recordings that took place during the specified call.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->listCallRecordings($account_id, $call_id, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->listCallRecordings: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\CallRecordingMetadata[]

Authorization

OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

transcribeCallRecording()

transcribeCallRecording($account_id, $call_id, $recording_id, $transcribe_recording)

URI(s):

Generate the transcription for a specific recording. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$recording_id = r-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Recording ID.
$transcribe_recording = new \Bandwidth\Model\TranscribeRecording(); // \Bandwidth\Model\TranscribeRecording

$hostIndex = 0;
$variables = [
];

try {
    $apiInstance->transcribeCallRecording($account_id, $call_id, $recording_id, $transcribe_recording, $hostIndex, $variables);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->transcribeCallRecording: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
recording_id string Programmable Voice API Recording ID.
transcribe_recording \Bandwidth\Model\TranscribeRecording
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

void (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateCallRecordingState()

updateCallRecordingState($account_id, $call_id, $update_call_recording)

URI(s):

Pause or resume a recording on an active phone call.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\RecordingsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string | Your Bandwidth Account ID.
$call_id = c-15ac29a2-1331029c-2cb0-4a07-b215-b22865662d85; // string | Programmable Voice API Call ID.
$update_call_recording = new \Bandwidth\Model\UpdateCallRecording(); // \Bandwidth\Model\UpdateCallRecording

$hostIndex = 0;
$variables = [
];

try {
    $apiInstance->updateCallRecordingState($account_id, $call_id, $update_call_recording, $hostIndex, $variables);
} catch (Exception $e) {
    echo 'Exception when calling RecordingsApi->updateCallRecordingState: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string Your Bandwidth Account ID.
call_id string Programmable Voice API Call ID.
update_call_recording \Bandwidth\Model\UpdateCallRecording
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

void (empty response body)

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]