PHP Libraries

Below are PHP samples to help you with your AppworX development.

Code to place a Phone Call

This code assumes the session is already established.
		$callId = $client->create_call( $error, array(
			 'userId' => $userId,
			 'origination' => '3:3035557777',
			 'destination' => '3:3035558888',
			 'text' => 'original scheduled call',
			 'time' => time() + 3600
		) );
		

Code to create an Auto-Conference Call

This code assumes the session is already established.
		$autoconferenceId = $client->create_autoconference( $error, array(
			 'userId' => 517,
			 'origination' => '3:3035557777',
			 'phoneNumber' => '3:3035558888',
			 'text' => 'sales meeting autoconference',
			 'pin' => '13456#'
		) );
		

Auto-Conference Call

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); } ?>


Copyright © 2010, IntelePeer, Inc. All Rights Reserved. Privacy Policy