ReelSurfer Beta API
The ReelSurfer API provides cross-platform, programmatic access to ReelSurfer functionality via the XML-RPC protocol. Note that we are still in beta, so please excuse any kinks. We'll have a support forum up soon, but for now please email all questions to support@reelsurfer.com.
Getting Started
Here's what you'll need to do to get started using our API:
- Create an account on http://reelsurfer.com
- Email support@reelsurfer.com with your username requesting an API key (until we get our automated system up)
- Download an XML-RPC client library for your language/development environment of choice. For Javascript, we recommend Mimic, and for PHP, we're on the CodeIgniter framework and use their built-in XML-RPC class.
Connecting to the API
The ReelSurfer API endpoint is at:
http://reelsurfer.com/api
In addition, you'll have to include your API key as a request header by the name of 'Rs-api-key'. Here's a very basic example in Javascript (your client library/framework will probably have a better method for setting headers):
var request = new XMLHttpRequest(); request.setRequestHeader("Rs-api-key","wrAsTezeph5ZA6rE2AqUC");
Here's an example API web client written in PHP utilizing the Mimic Javascript library to connect to the ReelSurfer API: http://code.reelsurfer.com/trac/attachment/wiki/PublicApi/apiclient.zip
Simply extract the ZIP in a web accessible directory and open up the apiclient/index.php test page.
Method Reference
Below are the available API methods:
add_clip()
/**
* Creates a new clip.
*
* @param array parameters array containing following struct:
* param 0: struct assoc array of media info w/following keys:
* provider_id media provider type: 1=YouTube, 2=Vimeo
* media_id string media provider-specific id
* title string media title
* duration_ms int media duration
* param 1: struct assoc array of clip info w/following keys:
* start_ms int start offset in milliseconds
* stop_ms int stop offset in milliseconds
* clip_title string (optional) custom clip title
* @return struct assoc array containing following key/value pairs:
* share_id int id of shared clip
*/
Sample Javascript parameters:
{ provider_id:1, media_id:'CdfJMZVt7pI', title:'Panda video', duration_ms:108000, }, { start_ms:10000, stop_ms:20000, clip_title:'My cool panda clip', }
Sample Javascript response:
'share_id' => "17817"
Once you have the returned share id, you can use it to generate an embed code, which is simply an iframe. For the source, use:
http://reelsurfer.com/share/embed/share/{share_id}
You can also change the dimensions as you wish (adjust the "width" and "height" attributes of the iframe). The complete example:
<iframe width="640" height="360" src="http://reelsurfer.com/share/embed/share/17817" frameborder="0" allowfullscreen></iframe>
Attachments (1)
- apiclient.zip (5.1 KB) - added by cyang 5 weeks ago.
Download all attachments as: .zip
