Code to create a Session, an Auto-Conference Call and share the returned information
<?php
// authentication information
$eid = 100;
$secret = '87h-989173hfv91h';
$AppworXDNS = ‘appworx.dnsAddress.com';
require_once('restLibrary1.4.php');
// create AppworX client class
$client = new OCPRestClient( $AppworXDNS, $sessionId );
// get the user id for this user
$userId = $client->retrieve_uidbyemail( $error, array( 'email' => ‘joe@intelepeer.com’ ) );
// list parameters
$params = array(
'userId' => $userId,
'origination' => '3:3035557777',
'phoneNumber' => '3:3035558888',
'text' => 'original scheduled autoconference',
'pin' => '13456#'
);
if( $autoconferenceId = $client->create_autoconference( $error, $params ) ){
// if autoconference is created, do something
echo "created autoconference with autoconferenceId: $autoconferenceId";
}else{
// if there was a problem with the request, do something else.
echo "Oops, there was a problem creating the autoconference. Here’s the details of the problem ";
print_r($error);
}
?>
Place a Call
Code to create a Session, Place a Call and share the returned information
<?php
// authentication information
$eid = 100;
$secret = '87h-989173hfv91h';
$AppworXDNS = ‘appworx.dnsAddress.com ';
require_once('restLibrary1.4.php');
// create AppworX client class
$client = new OCPRestClient( $AppworXDNS, $sessionId );
// get the user id for this user
$userId = $client->retrieve_uidbyemail( $error, array( 'email' => ‘joe@intelepeer.com’ ) );
// list parameters
$params = array(
'userId' => $userId,
'origination' => '3:3035557777',
'destination' => '3:3035558888',
'text' => 'original scheduled call',
'time' => time() + 3600
);
if( $callId = $client->create_call( $error, $params ) ){
// if call is created, do something
echo "created call with id: $callId";
}else{
// if there was a problem with the request, do something else.
echo "Oops, there was a problem creating the call. Here’s the details of the problem ";
print_r($error);
}
?>