PHP code example of kureikain / bandwidth-alpaca

1. Go to this page and download the library: Download kureikain/bandwidth-alpaca library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kureikain / bandwidth-alpaca example snippets




// This file is generated by Composer
elow)

$auth = array('username' => 'pksunkara', 'password' => 'password');

$client = new Bandwidth\Client($auth, $clientOptions);

$client = new Bandwidth\Client('1a2b3', $clientOptions);

$response = $client->klass('args')->method('args', $methodOptions);

$response->code;
// >>> 200

$response->headers;
// >>> array('x-server' => 'apache')

$response->body;
// >>> array('user' => 'pksunkara')

$body = 'username=pksunkara';
// >>> 'username=pksunkara'

$body = array('user' => 'pksunkara');
// >>> 'user=pksunkara'

$body = array('user' => 'pksunkara');
// >>> '{"user": "pksunkara"}'

$account = $client->account("u-account_id_in_bandwidth");

$response = $account->show($options);

$response = $account->transactions($options);

$messages = $client->messages("u-account_id_in_bandwidth");

$response = $messages->fetch($options);

$response = $messages->create($options);

$response = $messages->show("111111", $options);

$numberInfo = $client->numberInfo("14084442222 //or 408444222 is ok");

$response = $numberInfo->show($options);

$errors = $client->errors("u-account_id_in_bandwidth");

$response = $errors->show("error_id", $options);

$response = $errors->fetch($options);

$availableNumbers = $client->availableNumbers("u-account_id_in_bandwidth");

$response = $availableNumbers->searchLocal("San Jose", "CA", 95111, 408, "4083", true, 10, "*2%3F9", $options);

$response = $availableNumbers->createLocal("San Jose", "CA", 95111, 408, "4083", true, 10, $options);

$response = $availableNumbers->searchTollFree($options);

$response = $availableNumbers->createTollFree($options);

$calls = $client->calls("u-account_id_in_bandwidth");

$response = $calls->dtmf("111111", $options);

$response = $calls->recordings("111111", $options);

$response = $calls->updateGather("111111", "222222", $options);

$response = $calls->fetch($options);

$response = $calls->create("4081112244", "6501112222", $options);

$response = $calls->show("111111", $options);

$response = $calls->update("111111", $options);

$response = $calls->audio("111111", $options);

$response = $calls->createGather("111111", $options);

$response = $calls->gather("111111", "222222", $options);

$phoneNumbers = $client->phoneNumbers("u-account_id_in_bandwidth");

$response = $phoneNumbers->fetch($options);

$response = $phoneNumbers->create("+19195551212", "u-hdsadasdsad7-sample-app-id", "Customer Name", "Default NC Number", $options);

$response = $phoneNumbers->showById("sample_number_id", $options);

$response = $phoneNumbers->showByNumber("+14083872696", $options);

$response = $phoneNumbers->update("n-111111", $options);

$response = $phoneNumbers->destroy("n-111111", $options);

$conferences = $client->conferences("u-account_id_in_bandwidth");

$response = $conferences->create("+14081112323", $options);

$response = $conferences->createMember("conf-2jir46wjc5puqpiwthqma5y", "c-m2vrf4lpryjlvwgvsnf6ery", $options);

$response = $conferences->audio("conf-2jir46wjc5puqpiwthqma5y", $options);

$bridges = $client->bridges("u-account_id_in_bandwidth");

$response = $bridges->create("true", "c-m2vrf4lpryjlvwgvsnf6ery", $options);

$response = $bridges->audio("b_bridge_id_in_bandwidth", $options);

$response = $bridges->listCall("b_bridge_id_in_bandwidth", $options);

$response = $bridges->update("b_bridge_id_in_bandwidth", $options);

$recordings = $client->recordings("u-account_id_in_bandwidth");

$response = $recordings->show("r_recoridng_id_in_bandwidth", $options);

$response = $recordings->fetch($options);
bash
$ php composer.phar update