Skip to content

Commit

Permalink
updated read
Browse files Browse the repository at this point in the history
  • Loading branch information
Fermin committed Aug 7, 2023
1 parent c84a19d commit 0689adc
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ $fields['last_name'] = "Doe";
$fields['address1'] = "123 Fake St";

try {
$agentApi = new Client(getenv('YOUR_VICIDIAL_IP'), getenv('YOUR_VICIDIAL_USER'), getenv('YOUR_VICIDIAL_PASSWORD'));
$agentApi = new Client(
getenv('YOUR_VICIDIAL_IP'),
getenv('YOUR_VICIDIAL_USER'),
getenv('YOUR_VICIDIAL_PASSWORD')
);
echo $agentApi->updateFields("gabriel", $fields);
} catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), "\n";
Expand All @@ -51,7 +55,11 @@ Example 2: Hangup Call, Dispo it and Pause Agent
use Vicidial\Api\Wrapper\Agent\Client;

try {
$agentApi = new Client(getenv('YOUR_VICIDIAL_IP'), getenv('YOUR_VICIDIAL_USER'), getenv('YOUR_VICIDIAL_PASSWORD'));
$agentApi = new Client(
getenv('YOUR_VICIDIAL_IP'),
getenv('YOUR_VICIDIAL_USER'),
getenv('YOUR_VICIDIAL_PASSWORD')
);
$agentApi->pause("gabriel", "PAUSE");
$agentApi->hangup("gabriel");
$agentApi->dispo("gabriel", ['value' => 'SALE']);
Expand All @@ -73,7 +81,11 @@ Example 3: Update fields on agent screen
$fields['address1'] = "123 Fake St";

try {
$agentApi = Client::create(getenv('YOUR_VICIDIAL_IP'), getenv('YOUR_VICIDIAL_USER'), getenv('YOUR_VICIDIAL_PASSWORD'));
$agentApi = Client::create(
getenv('YOUR_VICIDIAL_IP'),
getenv('YOUR_VICIDIAL_USER'),
getenv('YOUR_VICIDIAL_PASSWORD')
);
echo $agentApi->updateFields("gabriel", $fields);
} catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), "\n";
Expand All @@ -90,7 +102,11 @@ Example 3: Update fields on agent screen
use Vicidial\Api\Wrapper\Admin\Client;

try {
$agentApi = new Client(getenv('YOUR_VICIDIAL_IP'), getenv('YOUR_VICIDIAL_USER'), getenv('YOUR_VICIDIAL_PASSWORD'));
$agentApi = new Client(
getenv('YOUR_VICIDIAL_IP'),
getenv('YOUR_VICIDIAL_USER'),
getenv('YOUR_VICIDIAL_PASSWORD')
);
echo $agentApi->moh_list([
'format' => 'selectframe',
'comments' => 'fieldname',
Expand All @@ -115,7 +131,13 @@ Url encode
$fields['phone_number'] = "18002474747";

try {
$agentApi = new Client(getenv('YOUR_VICIDIAL_IP'), getenv('YOUR_VICIDIAL_USER'), getenv('YOUR_VICIDIAL_PASSWORD'), "test", false);
$agentApi = new Client(
getenv('YOUR_VICIDIAL_IP'),
getenv('YOUR_VICIDIAL_USER'),
getenv('YOUR_VICIDIAL_PASSWORD'),
"test",
false
);
echo $agentApi
->withUrlEncode(true)
->add_lead($fields);
Expand Down

0 comments on commit 0689adc

Please sign in to comment.