Stickam | Mobile | Developers | PayPerLive | LiveCitizen
 

StreamAPI PHP Library

StreamApiPHP is a PHP interface to the StreamAPI REST API. The downloaded library consists of 2 folders. The first folder is Services, which contains the main classes of the API. The second folder is tests, which contains examples on how you can call the StreamAPI REST API methods. To start, you'll need to download the StreamApiPHP library.
Download (Ver 1.0)
StreamApiPHP.zip
StreamApiPHP.tar.gz

To start using this library, you'll need to modify Service/StreamAPI/Config.php file to fill in values for $API_KEY, $SECRET_KEY, and $SITE_ID

class Service_StreamAPI_Config
{
	public static $API_KEY = '';		// fill this out with YOUR assigned api key
	public static $SECRET_KEY = ''; 	// fill this out with YOUR assigned secret key
	public static $SITE_ID = '';		// fill this out with YOUR assigned site id
	public static $URL = 'http://api.streamapi.com/service';
	public static $TIMEOUT = 30;	
	public static $DEBUG = false;
}

To create or get information about a StreamAPI session, you'll need to include the Service/StreamAPI.php and create a new Service_StreamAPI object. You can create a session without any parameters. You can also create a session that will use FME (Flash Media Encoder) for its live session by passing in YOUR fme_key value for that particular user. If you want YOUR site's registered members to be the only users who can view a particular session, you can pass in the value true to the createSession() function. You can look at the Test/TestCreateSession.php for a sample on how to create a session.

Here's a link to an example of how you can create a session, start a live session, and join that particular live session. To try out this code example on your server, you need to make sure that you fill out the proper values for the following:$defaultLayoutPath, $defaultSkinPath

PHP Code Sample

You can check out examples on how to call the other StreamAPI calls under the Test directory of the PHP client library.