Documentation

Embedding your first recorder


To embed your first recorder on your website follow these simple steps:

  1. Sign in to your Pipe account area
  2. The lower right panel contains the embed code, copy it
  3. Paste the code in your HTML page.
  4. Refresh the page in your browser on your desktop or mobile

Pipe will detect mobile and desktop browsers automatically and the proper interface will be loaded.

Viewing your recordings


You can see all the recordings on your account under the Recordings tab.

Every recording will appear here along with other useful information.

The following information will be shown for each recording:

Initial information The ID of the recording as it is stored in our database, the date and time when the recording was made and the IP from which it was made
Source The source (Computer or Mobile) along with the browser and OS, microphone and camera names, file name, format, original size and the payload sent with the video
Transcoded recording resolution if it is a video recording, recording duration, bitrate, converted format and converted file size
Thumbnail The thumbnail of the recording if (snapshot if it is a video recording or a mic icon to simbolize an audio only recording)
Status The status of all the processes in the pipeline along with the status of their respective webhooks
Action Buttons for embeding the recording, saving the recording and uploading to YouTube.

Once the recording is converted, all the information will be available

Changing the recorder size


The recorder size is different on desktop and mobile devices.

Recorder size on desktop devices

The size of the recorder on desktop devices can be changed directly from the embed code or using our embed tool as shown below.

In your Pipe account area, under the "Embed Recorder" tab, you will find the following panel with the width and height options:


Use the 2 inputs to specify the size of the embedded recorder in pixels as it will be shown by desktop devices.

After you enter your desired size, press the "Generate Embed Code" button to update the size values in the embed code.

The size of the recorder won't affect the size & quality of the videos recorded.

Recorder size on mobile devices

On mobile devices the recorder is included in a div. The width of the div containing the mobile recording area is relative to its parent element. The div will have a 100% width. The height is fixed at 120px.

Limiting the length of recordings


By default, the recordings are limited to 2 minutes (120 seconds). You can easily change this from your account area:

Set the desired length in seconds and press the "Generate Embed Code" to generate a new recorder wihich applies the limit.

You can also change the maximum length of recordings on desktop directly from the embed code.

Video quality options in Pipe


With Pipe you have full control over the video quality recorded on desktop devices. However what you configure Pipe to record at might not be what you finally get. Factors like webcam quality and available light always affect the final video. On mobile devices the quality depends 100% on the device.

Video quality on desktop devices

On desktop computers the quality depends on the configuration you specify in your embed code but also on the quality of the webcam (affects resolution and fps) and light available in the room (affects fps).

Pipe offers 4 predefined quality profiles:

  • 240p : 320x240px @ 30 FPS
  • 300p : 400x300px @ 30 FPS (default)
  • 480p : 640x480px @ 30 FPS
  • 720p : 1280x720px @ 30 FPS (HD)

To use one of the predefined quality profiles (240p, 300p, 480p and 720p HD ), all you have to do is to select it:

You can also create and use your own quality profiles. More information at Using your own quality profiles

The video quality is not affected by the recorder size. You can have a 640x480 recorder embedded on your page, recording at 720p resolution.

Note that the quality settings you change here will only affect the desktop recorder.

Video quality on mobile devices

The video quality for the recordings made with a mobile device depends on the device capabilities and the video recording settings on the device.

For example, iOS handles videos in different ways depending on when they are recorded:

  • If when prompted you choose an existing video, that video will be compressed but the resolution will remain the same
  • If when prompted you choose to record a new video, that video will be recorded at 360x480 (portrait) and 480x360 (landscape).

Using your own quality profiles


Pipe allows you to use your own video quality profile (XML file hosted your website) by linking directly to it, in the embed code, using the qualityurl parameter.

Step 1: create your own video quality profile file and host it

Here are the 3 video quality profiles available through the Pipe account area: 240p, 300p, 480p and 720p. Download one, make your changes and upload it to your website. You can change the resolution, frames per second, picture quality and more.

Step 2: link to the new .xml file in your Pipe embed

Setup the qualityurl parameter to automatically load the .xml file through http or https depending on where Pipe is embedded. Here's an example code:

var flashvars = {qualityurl: ('https:' == document.location.protocol ? 'https://' : 'http://') +"yourdomain.com/quality_profile.xml",accountHash:"your_account_hash", eid:1, showMenu:"true", mrt:5,sis:0,asv:1};

Step 3: allow Pipe to load the .xml file from your website

In order for Pipe to be able to load your custom .xml video quality profile, you will need to do the following:

  1. Create a crossdomain.xml policy file (necessary for the Flash client) and put it in the root of your website. Here is the cross domain policy file that allows Pipe to load video quality profiles from your website:
    <cross-domain-policy>
    <allow-access-from domain="*.addpipe.com"/>
    </cross-domain-policy>
    Put the code above in a text file named crossdomain.xml. It should be acessible at http://yourwebsite.com/crossdomain.xml.
  2. Enable CORS on the server on which you are hosting the custom .xml video quality profile (necessary for the HTML5 client). For example on Apache, one of the most commonly used webservers, to add the CORS authorization to the header you must simply add the following line in either the Directory, Location, Files or VirtualHost sections of your server config (usually located in a *.conf file, such as httpd.conf or apache.conf), or within a .htaccess file:
    Header set Access-Control-Allow-Origin "*"
    For more details on how to configure CORS on other servers see https://enable-cors.org/server.html

Recorder looks


Control menu

You can opt to hide the control menu of the recorder. You may want to do this if you decide to control the recorder using the JavaScript Control API

Colors

You can change the colors of the desktop recorder to better fit your website design

These can be changed from your account area or from the embed code directly

To change the colors from you account area, you will have to access the Advanced Options panel:

This will open up the design customization panel. Now you will be able to change the colors. Once you're done, press the "Generate Embed Code" to see the changes.

Corners

You can change the corner radius of the desktop recorder by changing the value of the "Corner Radius" field:

Working directly with the embed code


You can change settings directly in your embed code. Size, quality, colors or maximum recording time and payload data can be set here directly. This allows you to configure Pipe directly on your website.

You can change the size of the recorder directly in this code without the need to use the generator in your account area everytime you want to change it.

var size = {width:320, height:270}; this line must be edited in order to change the size of the recorder.

var flashvars will contain an array of different settings that you can change:

qualityurl is the path to the quality profile. Right now, you can choose between avq/240p.xml,avq/480p.xml and avq/720p.xml or it can be the path to your custom quality profile (works only on desktop devices)
accountHash this is the hash value of your account. This value should not be changed
showMenu true if the control menu will be visible or false if it won't
mrt the maximum recording time in seconds (works only on desktop devices)
bgCol the background color of the recorder
menuCol the color of the control menu of the recorder
sis short for skip initial screen. When set to 1, the initial screen with the [Record Video] or [Record Audio] text will not be shown, skipping directly to the recording screen.
st short for show timer and goes hand in hand with the showMenu setting. When set to 0 will hide the recording timer altogether when the recorder menu is not shown.
ssb short for show settings buttons and goes hand in hand with the showMenu setting. When set to 0 will hide the microphone meter and icon when the recorder menu is not shown.

Pushing videos to FTP/SFTP


Configuring

Videos can be pushed to any server using FTP or SFTP after conversion. You will just need the host address and a user with writing permissions.

To set this up, just fill in the form in the "SFTP or FTP" page with the required credentials and you're good to go.

Note: It's recommended to create a new user with writing permissions only to the folder in which you want to push the converted files.

(S)FTP Logs

In this page you will also find the latest 100 attempts to push to the FTP account you povided.

ID The ID of the recording that was pushed to your Amazon S3 bucket.
Date Date and time the push attempt was made.
Host The address of the server to which the recording was pushed
Username The username of the used account.
Folder The folder in which the recording was stored.
File The filename with the .mp4 extension.
Status The status returned by the server (in case of errors, you should see here).

FTP Upload Status Types

OK Upload of the file was successful
FILE_MISSING The local file of the recording on Pipe's storage is missing
UPLOAD_FAILED This may be triggered by various causes, but mostly it is a permission problem on the remote folder, a connection interruption while uploading or a file size constraint
FTP_LOGIN_FAILED Either the username or password for FTP connection are incorrect
INCORRECT_FTP_FOLDER The directory or the path to the directory in which the recording should be uploaded does not exist or is incorrectly named
FTP_CONNECTION_TIMEOUT The remote server timed out the FTP connection. This can happen if the remote server is behind a firewall, if does not accept remote connections or if it is offline altogether

SFTP Upload Status Types

OK Upload of the file was successful
FILE_MISSING The local file of the recording on Pipe's storage is missing
UPLOAD_FAILED This may be triggered by various causes, but mostly it is a permission problem on the remote folder, a connection interruption while uploading or a file size constraint
SFTP_LOGIN_FAILED Either the username or password for SFTP connection are incorrect
INCORRECT_SFTP_FOLDER The directory or the path to the directory in which the recording should be uploaded does not exist or is incorrectly named
SFTP_CONNECTION_TIMEOUT The remote server timed out the SFTP connection. This can happen if the remote server is behind a firewall, if does not accept remote connections or if it is offline altogether

Pushing videos to Amazon S3


After conversion, the final .mp4 videos can be pushed to your own Amazon S3 bucket for storage and delivery. You'll need an S3 bucket and security credentials.

Creating an Amazon S3 bucket

The 1st thing you need is an S3 bucket so let's create one:

  1. First of all, create an Amazon S3 account. Go to aws.amazon.com/s3/ and press the "Sign in to the Console" button:
  2. After you log in click the "Create Bucket" button:
  3. Type in the bucket name and select the region and press the "Create" button:

Obtaining the security credentials

The converted mp4 files can be uploaded to an Amazon S3 bucket after the recording is uploaded and converted. Setting this up will require the following information:

  • Access Key ID
  • Secret Access Key
  • S3 Bucket Name
  • S3 Bucket Region

To obtain these informations, log into your Amazon AWS account.

Then go to Security Credentials in the top right menu under your name.

Press Access Keys (Access Key ID and Secret Access Key)

Click on the button

then press the link.

Your access keys will show

Configuring Pipe to push to your bucket using your credentials

After you get all the required information, go to the Amazon S3 tab in your Pipe account and paste all the info in the form.

After you click Save all new videos will be pushed to your S3 bucket.

Be advised: We are using S3 with ACL uploading, so if you are using Amazon's IAM system and you've created a costum policy for your Amazon user that is doing the upload to S3 and you are using a public Canned ACL, add the following permission/action for it: s3:PutObjectAcl. All policies require the s3:PutObject permission, regardless of the type of Canned ACL that you selected.

S3 Logs

The log containing information about the latest 100 attempts to push the converted files to the S3 bucket will show the following:

Video ID The ID of the recording that was pushed to your Amazon S3 bucket.
Date Date and time the push attempt was made.
Key ID The Key of your Amazon S3 bucket.
Secret The Secret Key of your Amazon S3 bucket.
Bucket Name The name of the Bucket to which the recording is pushed.
Bucket Region The region of the Bucket to which the recording is pushed.
ACL The Canned ACL selected for the object, in this case the recording when it is pushed.
URL The URL of the file on your server.
Status The status returned by the server (in case of errors, you should see here).

Pushing videos to Dropbox


After conversion, the final .mp4 videos can be pushed to your own Dropbox folder for storage. You'll need a Dropbox account and access token.

Creating your Dropbox application

The 1st thing you need is a Dropbox app so let's create one:

  1. First of all, sign in to your Dropbox account at dropbox.com
  2. .
  3. After you log in, go to the Developer Page and click [Create App] in the top right corner under your name:
  4. In the next page:
    • select Dropbox API
    • select App folder access
    • Name your app and click [Create App]

Obtaining the Dropbox access token

The converted mp4 files can be uploaded to your Dropbox folder after the recording is uploaded and converted. Setting this up will require the following information:

  • Dropbox Access token
  • Dropbox Folder name

After the app is created you will be redirected to the app settings page. Scroll down a bit and in the OAuth 2 section
click [Generate] for the access token.

Configuring Pipe to push to your Dropbox folder using your credentials

After you get the acces token, go to the Dropbox tab in your Pipe account and paste it in the form.

For the Dropbox Folder, you can choose any name you wish. The videos and snapshots will be pushed to /Apps/your app name/folder name .

After you click [Save Dropbox Credentials] all new videos will be pushed to your Dropbox folder.

Dropbox Logs

The log containing information about the latest 100 attempts to push the converted files to the Dropox folder will show the following:

ID The ID of the recording that was pushed to your Dropbox folder.
Date Date and time the push attempt was made.
Token The Access Token of your Dropbox folder.
Folder The name of the folder to which your recording and snapshot is pushed.
File(s) The name of the recording and snapshot (for video recordings).
Status The status returned by the server (errors will be displayed here if the case).

Not storing videos on Pipe's storage


Pipe gives you to the option to not store your videos on the Pipe storage. This option is available per environment in the environment settings.

If you activate this option, Pipe will delete the original recording, the .mp4 recording and the snapshot as soon as the .mp4 recording and .jpg snapshot are pushed to all your configured storage options ((S)FTP, S3, Dropbox).

This affects only the videos recorded after the setting is on. Prior recordings won't be removed. If you have more than one storage option configured and one of them fails, the files will be kept and another attempt to push the files to the failed storage option will be made every 5 minutes. Once the push to all configured storage options succeeds the files will be removed from our servers.

Setting up webhooks


Webhooks can be used to get notified whenever a new recording is made using an embedded recorder registered with your account. Multiple webhooks can be set per account.

Setting up the link

Go to your account and click on the Webhooks tab.
To add a new webhook simply click on the Create New Webhook button. You will be taken to the webhook setup page:

Webhook types

There are 5 types of webhooks that can be sent:

  1. video_recorded: sent each time a recording is made.
  2. video_transcoded: sent each time a recording is transcoded.
  3. video_copied_ftp: sent each time a recording is copied to (S)FTP.
  4. video_copied_s3: sent each time a recording is copied to your Amazon S3.
  5. video_copied_dbox: sent each time a recording is copied to Dropbox.

Data sent

With every webhook event a variable named payload will be POSTed to the specified URL with the application/x-www-form-urlencoded content type. The value of the variable will be specific for each event.

Here are the different types of values:

{
	"version":"1.0",
	"event":"video_recorded",
	"data":{
		"videoName":"vs1457013120534_862",
		"audioCodec":"NellyMoser ASAO",
		"videoCodec":"H.264",
		"type":"FLV",
		"orientation":"landscape",
		"id":"123",
		"dateTime":"2016-03-03 15:51:44",
		"timeZone":"Europe/Bucharest",
		"payload":"your payload data string",
		"httpReferer":"http://site_from_where_video_was_recorded.com"
	}
}
{
	"version":"1.0",
	"event":"video_transcoded",
	"data":{
		"videoName":"recording name here",
		"duration":"7.56",
		"audioCodec":"AAC",
		"videoCodec":"H.264",
		"type":"MP4",
		"size":194373,
		"width":320,
		"height":240,
		"orientation":"landscape",
		"id":"123",
		"dateTime": "2015-10-10 16:00:36",
		"timeZone":"Europe/Bucharest",
		"url":"https://addpipevideos.s3.amazonaws.com/b8e2f5bfd04a93b434bd8c740bff744d/vid.mp4",
		"snapshotUrl":"https://addpipevideos.s3.amazonaws.com/b8e2f5bfd04a93b434bd8c740bff744d/vid.jpg",
		"payload":"your payload data string",
		"httpReferer":"http://site_from_where_video_was_recorded.com"
	}
}
{
	"version":"1.0",
	"event":"video_copied_ftp",
	"data":{
		"ftpUploadStatus":"upload success",
		"videoName":"vs1457013120534_862",
		"duration":7,
		"audioCodec":"AAC",
		"videoCodec":"H.264",
		"type":"MP4",
		"size":493534,
		"width":320,
		"height":240,
		"orientation":"landscape",
		"id":"123",
		"payload":"your payload data string",
		"httpReferer":"http://site_from_where_video_was_recorded.com"
	}
}
{
	"version":"1.0",
	"event":"video_copied_s3",
	"data":{
		"s3UploadStatus":"upload success",
		"videoName":"vs1457013120534_862",
		"duration":7,
		"audioCodec":"AAC",
		"videoCodec":"H.264",
		"type":"MP4",
		"size":493534,
		"width":320,
		"height":240,
		"orientation":"landscape",
		"id":"123",
		"url":"https://bucketname.s3.amazonaws.com/vs1457013120534_862.mp4",
		"snapshotUrl":"https://bucketname.s3.amazonaws.com/vs1457013120534_862.jpg",
		"bucket":"bucketname",
		"region":"us-east-1",
		"acl":"public-read",
		"payload":"your payload data string",
		"httpReferer":"http://site_from_where_video_was_recorded.com"
	}
}
{
	"version":"1.0",
	"event":"video_copied_dbox",
	"data":{
		"dboxUploadStatus":"upload success",
		"videoName":"vs1457013120534_862",
		"duration":7,
		"audioCodec":"AAC",
		"videoCodec":"H.264",
		"type":"MP4",
		"size":493534,
		"width":320,
		"height":240,
		"orientation":"landscape",
		"id":"123",
		"payload":"your payload data string",
		"httpReferer":"http://site_from_where_video_was_recorded.com"
	}
}

For audio only recordings, webhook will not contain the following data: width, height, video codec, snapshot URL and orientation.

Handling the data

The data is URL encoded in transit. This means that depending on the specific function of the programming language you are using, you will either be working with the raw URL encoded data or the URL decoded data.

Some examples:

In PHP if you are using php://input for receiving the data you will be working with the raw URL encoded data, but if you are using $_POST["payload"] for receiving the data, it will automatically be URL decoded.

In .NET Request.InputStream will receive the raw URL encoded data while Request.Form["payload"] will automatically URL decode the data.

In Ruby on Rails request.raw_post will receive the raw URL encoded data while params["payload"] will automatically URL decode the data

Here's an example of the video_recorded event data being received in the two possible ways.

Raw POST data (URL encoded) Value of payload var (URL decoded)
payload%7B%22version%22%3A%221.0%22%2C%22event
%22%3A%22video_recorded%22%2C%22data%22%3A%7B%22
videoName%22%3A%22vs1457013120534_862
%22%2C%22audioCodec%22%3A%22NellyMoser%20ASAO
%22%2C%22videoCodec%22%3A%22H.264%22%2C%22
type%22%3A%22FLV%22%2C%22orientation%22%3A%22
landscape%22%2C%22id%22%3A%22123%22%2C%22d
ateTime%22%3A%222016-03-03%2015%3A51%3A44%22%2C%22
timeZone%22%3A%22Europe%2FBucharest%22%2C%22
payload%22%3A%22your%20payload%20data%20string%22%2C%22
httpReferer%22%3A%22http%3A%2F%2F
your_site.com%22%7D%7D
{
	"version":"1.0",
	"event":"video_recorded",
	"data":{
		"videoName":"vs1457013120534_862",
		"audioCodec":"NellyMoser ASAO",
		"videoCodec":"H.264",
		"type":"FLV",
		"orientation":"landscape",
		"id":"123",
		"dateTime":"2016-03-03 15:51:44",
		"timeZone":"Europe/Bucharest",
		"payload":"your payload data string",
		"httpReferer":"http://your_site.com"
	}
}

Every parameter explained

Let's talk about the information sent by these webhooks

version is the current version of the Pipe's webhook API.

event is the name of the event that triggered this call

videoName is the name of the recording

duration is the duration in seconds with two decimals

audioCodec is the used audio codec namely AAC

videoCodec is the used video codec namely H.264. This is not sent for an audio only recording.

type is the original's recording file type. This can give you a clue on where this recording is coming from (for example, an iPhone will produce .mov files while the desktop recorder will produce .flv files)

size is the size in bytes

width and height represents the size of the original recording. This can also give you a clue about the device the recording is coming from. These are not sent for an audio only recording.

orientation represents the orientation of the device when the recording was made. This could be either "landscape" or "potrait". This is not sent for an audio only recording.

id is the ID of the recording as you will find it in your Pipe account area and as it is stored on our servers.

dateTime is the date and time relative to your timezone settings at which the recording has finished converting.

timeZone represents your selected time zone in the account settings.

url

  • For thevideo_transcoded event, it is the full path to where the recording is located on our S3 storage.
  • For thevideo_copied_s3 event, it is the full path to where the recording is located on your S3 bucket.

snapshotUrl

  • For thevideo_transcoded event, it is the full path to where the snapshot is located on our S3 storage. This is not sent for an audio only recording.
  • For thevideo_copied_s3 event, it is the full path to where the snapshot is located on your S3 bucket. This is not sent for an audio only recording.

payload is the payload data in string format that can be set initially in the embed code of Pipe. Find out more at: Sending custom data using payload.

ftpUploadStatus is the status of the (S)FTP upload.

s3UploadStatus is the status of the S3 upload.

bucketname is the name of the S3 bucket.

region is the server region of the S3 bucket.

acl is the Amazon S3 Access Control Lists type.

dboxUploadStatus is the status of the Dropbox upload.

httpReferer is the link to the site from which the recording was made.

Logs

The Webhook log will show the latest 100 requests to send data via Webhook.

The following information is available in this table:

ID The ID of the recording that sent the request to the webhook script
Date Date and time the request was made
URL The URL to the Webhook script called
Type The event that triggered the request (for now, the script will be called only when the recording has been converted)
Data sent The data that was sent via the Webhook script
HTTP Status The status returned by the server when the webhook script is called
Response The headers and the first 100 characters returned by the webhook script

Authenticating webhooks


Pipe automatically signs the webhook requests so you can (optionally) verify that the requests are coming from Pipe and not a third-party. This is usefull if your application exposes sensitive data, but it is not required. It just adds an additional layer of protection.

Pipe adds an additional HTTP header with the webhook POST requests, X-Pipe-Signature, which contains the specific signature for the request. To verify this request, you will need to generate a signature using the same key that Pipe uses (the one in your account webhook tab) and compare the value obtained with the value sent via header.

Getting your webhook authentication key

In the webhook tab of your account, a key is automatically generated. You can use this one or reset it to generate a new one at any time. Pipe will automatically use the newest one.

Generating your own signature for comparison

In the code that receives and processes the webhook request:

  1. Create a string of the webhook's URL, exactly as your entered it in Pipe. Pipe will always sign the webhook requests with the exact URL, so any small difference will prevent the signature from validating.
  2. Append the JSON POST data received via webhook to the URL string.
  3. Hash the resulting string with HMAC-SHA1, using the webhook authentication key from your account and generate a binary signature. Pipe uses binary signatures so be careful not to generate a hexadecimal signature.
  4. Base64 encode the binary signature.
  5. Compare the generated signature with the one provided by X-Pipe-Signature HTTP header.

Example of a PHP implementation of the steps above

  /**
  * Generates a base64-encoded signature for a Pipe webhook request.
  * @param string $webhook_key the webhook's authentication key
  * @param string $url the webhook url
  * @param array $jsonData the data in JSON format received via $_POST["payload"].
  */
  function generateSignature($webhook_key, $url,  $jsonData){

  $signed_data = $url;
  $signed_data .= $jsonData;

  return base64_encode(hash_hmac('sha1', $signed_data, $webhook_key, true));
  }
          

Receiving webhooks


Receiving the webhook data is very simple, here's an example in PHP:

$webhookData = json_decode($_POST["payload"], true);

The code above will make the data easily accesible in an associative array similar to the one shown here:

Array
(
    [version] => 1.0
    [event] => video_transcoded
    [data] => Array
        (
            [videoName] => vsrtc1501002174_491
            [duration] => 3.48
            [audioCodec] => AAC
            [videoCodec] => H.264
            [type] => MP4
            [size] => 442101
            [width] => 1280
            [height] => 720
            [orientation] => landscape
            [id] => 451464
            [dateTime] => 2017-07-25 20:03:05
            [timeZone] => Europe/Bucharest
            [url] =>  https://pipe-eu1.s3.eu-central-1.amazonaws.com/2044b9efed932689c4081a749a877413/vsrtc1501002174_491.mp4
            [snapshotUrl] =>  https://pipe-eu1.s3.eu-central-1.amazonaws.com/2044b9efed932689c4081a749a877413/vsrtc1501002174_491.jpg
            [doNotStore] => 0
            [payload] => {"userId":"55a95eeb936dd30100e0aff6","jobId":"55a7e6555f1bdc010014d6a1", "email":"asdasd@adasdae.com", "link":"https://www.amazon.com/D-G-P-4-W/dp/ref=as_li_ss_tl?ie=UTF8"}
            [httpReferer] => https://hdfvr.com/pipeTest/test.php
        )

)

So if you wish to get the videoName value for example you simply access it like this:
$vidName = $webhookData["data"]["videoName"].

Sending custom data


flashvar's payload property can be used to send data in string format to Pipe along with the recording. This can be useful if you wish to tunnel data - like user id or form id - from your embed code all the way to your webhooks.

The data must be in string format and the value of the payload property must not be longer than 500 characters.

Here's how to add the payload property to the flashvar object.

Default embed code:

var flashvars = {qualityurl: "avq/240p.xml",accountHash:"your_account_hash",showMenu:"true", mrt:120};

Embed code with the payload property added:

var flashvars = {qualityurl: "avq/240p.xml",accountHash:"your_account_hash",showMenu:"true", mrt:120, payload:"your_payload_data_string"};

Sending custom data in JSON format

The payload property can be used to send JSON as well. You have two formating options in order to send the JSON correctly:

  • enclose the JSON in quotes and write the JSON normally: payload:'{"a":"b"}'
  • enclose the JSON in double quotes and escape the double quotes from inside the JSON payload:"{\"a\":\"b\"}"

Retrieving the data

The payload data you've sent will be sent back to you with all the webhooks associated with the recording as the value of the payload name/value pair from the data object.

{
	"version":"1.0",
	"event":"video_transcoded",
	"data":{
		"videoName":"recording name here",
		"duration":"7.56",
		"audioCodec":"AAC",
		"videoCodec":"H.264",
		"type":"MP4",
		"size":194373,
		"width":320,
		"height":240,
		"orientation":"landscape",
		"id":"123",
		"dateTime": "2015-10-10 16:00:36",
		"timeZone":"Europe/Bucharest",
		"url":"http://s1.addpipe.com/v/b8e2f5bfd04a93b434bd8c740bff744d/vid.mp4",
		"snapshotUrl":"https://s1.addpipe.com/v/b8e2f5bfd04a93b434bd8c740bff744d/vid.jpg",
		"payload":"your_payload_data_string"
	}
}

JavaScript Control API (Desktop)


Note: JavaScript Control API is available only for the desktop recorder.

These are the functions used to control the recorder's interface using JavaScript functions.

These methods need to be called like this:

<script>
  document.VideoRecorder.function(passedParameters);
</script>

where VideoRecorder is the id of the object/embed containing the recorder .swf file.

What you can do with it

For example you could hide the default controls of the recorder and create your own controls using the Control API.

Here is the list of methods that you can call on the Pipe recorder:

record();

Description: This call will trigger the recorder to record a video or audio stream or to rerecord one if one is already recorded (equivalent to pressing the RECORD button).

It should be executed only after:

  1. onCamAccess is called by Pipe and the value of it's 1st parameter is true
  2. onRecorderReady is called by Pipe

If executed before the above 2 events the initial recording screen OR mic/cam device selection screens might be shown by Pipe in which case calling record() will do nothing.

Return Values: none

stopVideo();

Description: This call will trigger the Pipe desktop client to stop the recording of a stream if a recording is in progress.

Return Values: none

playVideo();

Description: This call will play the recorded stream if there is one. This will not be available during or before the recording process (equivalent to pressing the PLAY button).

Return Values: none

pause();

Description: This call will pause the video recording that is currently playing. The call will not do anything if a video recording is not playing. The call is equivalent to pressing the PAUSE PLAYBACK button. Calling the function a second time will not do anything, you need to call playVideo() to resume playback.

Return Values: none

save();

Description: If recording autosaving is disabled you can use this call to save the desired recording (equivalent to pressing the Save button). This will not be available if recording autosaving is enabled.

Return Values: none

getStreamTime();

Description: This will return the time of the played or the currently recording stream.

Return Values: a number with the current length of the recording (if called during the recording process)

getPlaybackTime();

Description: This will return the current time of the recording during playback.

Return Values: a number with the current time of the recording if called during the playback process or 0 if called outside playback

getStreamName();

Description: This call will return the stream name at any time but beware that the name of the stream might not be set at the time of the call. This is useful when you need the name of the stream during the recording.

Return Values: a string ,the stream name WITHOUT the filename extension (.flv , .f4v or .mp4). If the stream name is not set it will return an empty string.

Remove Pipe Recorder From Page

When the Pipe HTML5 recorder is used and it's part of a modal window that the user closes (either through CSS' display: none or by removing the modal DIV from the DOM) the webcam will continue to be acessed and it's light will continue to be turned on.

For this scenario we've built the following JS function that closes the media server connection, turns off the webcam access and clears the contents of the #hdfvr-content DIV returning the HTML source code to its initial state:removePipeRecorder();.

Execute it before closing the modal window. It works for both the Flash recorder and the HTML5 one.

JavaScript Events API (Desktop)


Every time something happens with the recorder (a button is pressed, the connection succeeds, etc.) a call is made to a JavaScript function with lots of info about the event.

What you can do with it

Here are some of the things you can trigger using the Event API

  • show a message, a warning or a timer in the html page
  • activate an input field or button in the html page
  • redirect the user to another page

Desktop recorder events and associated JS functions

Here is the list of events and associated JavaScript functions:

onRecorderInit(recorderId);

Description: Triggers after the initial [Record Video] or [Record Audio] screen is drawn.

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function onRecorderInit(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onRecorderInit("+args.join(', ')+")");
}

userHasCamMic(cam_number,mic_number, recorderId);

Description: Pipe detects the number of cams and mics a user has

Passed Parameters:
cam_number - number of web cam drivers the user has installed on his computer
mic_number - number of sound card and sound sources the user has installed on his computer
recorderId - variable sent via flash vars

Example:

function userHasCamMic(cam_number,mic_number, recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("userHasCamMic("+args.join(', ')+")");
}

btRecordPressed(recorderId);

Description: RECORD button is pressed

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function btRecordPressed(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("btRecordPressed("+args.join(', ')+")");
}

btStopRecordingPressed(recorderId);

Description: STOP RECORD button is pressed

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function btStopRecordingPressed(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("btStopRecordingPressed("+args.join(', ')+")");
}

btPlayPressed(recorderId);

Description: PLAY button is pressed

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function btPlayPressed(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("btPlayPressed("+args.join(', ')+")");
}

btPausePressed(recorderId);

Description: PAUSE button is pressed

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function btPausePressed(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("btPausePressed("+args.join(', ')+")");
}

onUploadDone(streamName, streamDuration, userId, recorderId, audioCodec, videoCodec, fileType, audioOnly);

Description: Recorded data finishes streaming/uploading to the media server

Passed Parameters:
streamName - a string representing the name of the stream WITHOUT the filename extension (.flv , .f4v or .mp4)
streamDuration - the duration of the recording/audio file in seconds but accurate to the millisecond (like this: 4.322)
userId - the userId sent via flash vars
recorderId - variable sent via flash vars
audioCodec - the audio codec used for the recording, Nelly Moser or Speex
videoCodec - the video codec used for the recording, Sorenson or H.264
fileType - flv (The original file format for the recording) audioOnly - true if it is an audio only recording, false otherwise

Example:

function onUploadDone(streamName, streamDuration, userId, recorderId, audioCodec, videoCodec, fileType){
	var args = Array.prototype.slice.call(arguments);
	alert("onUploadDone("+args.join(', ')+")");
}

onCamAccess(allowed, recorderId);

Description:

onCamAccess is triggered:

  1. when clicking the Allow or Deny radio buttons in Flash Player's camera/microphone Privacy panel. The Privacy panel will be brought up by the Pipe recorder but it can also be manually brought up by the user by right clicking on the Pipe client - your code should cope with onCamAccess being called at any time during Pipe client's lifetime. The function is triggered even if the user clicks the selected/active radio button.
  2. automatically if the [ ] Remember checkbox was previously selected in Flash Player's Privacy panel

Flash Player's Privacy Panel when presented by the Pipe recorder client:

Internet browsers like Chrome will ask again for permission to use the webcam through a separate dialog box:

At the moment there is no way to catch the user's response to Chrome's dialog box.

Chrome pausing Flash animations to save battery life

Chrome will intelligently pause Flash content to save battery life.

This applies to smaller Pipe embeds too.

When Pipe is paused by Chrome, onCamAccess will be called, while the Pipe recorder is apparently paused, if all these 3 conditions are met:

  1. skip initial screen is on (sis:1 in the embed code)
  2. the user has only 1 webcam and 1 microphone
  3. you have previously checked [ ] Remember in FP's Privacy panel

In this scenario onCamAccess will be called, followed by onFlashReady, while the Pipe recorder is apparently paused.

Here's how Pipe looks when it's paused by Chrome:

Use 400x300px size or bigger for Pipe embeds to prevent it from being paused by Chrome.

Passed Parameters:
allowed is true if:

  • the user clicked the [Allow] button OR
  • clicked [Allow] + [Remember] in a previous session (in which case Flash Player's Privacy dialog box is not shown)
and false if
  • the user clicked the [Deny] button OR
  • if a user clicked [Deny] + [Remember] in a previous session (in which case Flash Player's Privacy dialog box is not shown)
recorderId - variable sent via flash vars

Example:

function onCamAccess(allowed, recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onCamAccess("+args.join(', ')+")");
}

onPlaybackComplete(recorderId);

Description: Pipe finishes playback of recording stream

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function onPlaybackComplete(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onPlaybackComplete("+args.join(', ')+")");
}

onSnapshotTaken(recorderId);

Description: The snapshot has just been captured by Pipe

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function onSnapshotTaken(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onSnapshotTaken("+args.join(', ')+")");
}

onRecordingStarted(recorderId);

Description: the Pipe desktop client starts recording

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function onRecordingStarted(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onRecordingStarted("+args.join(', ')+")");
}

onConnectionClosed(recorderId);

Description: the Pipe desktop client looses the connection to the media server

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function onConnectionClosed(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onConnectionClosed("+args.join(', ')+")");
}

onFPSChange(recorderId,currentFPS);

Description: Called by the Pipe desktop client every second

Passed Parameters:
recorderId - variable sent via flash vars
currentFPS - the current frames-per-second that the Pipe desktop client reports (during recording, playback, uploading or saving) depending of the state of the Pipe desktop client

Example:

function onFPSChange(recorderId,currentFPS){
	var args = Array.prototype.slice.call(arguments);
	alert("onFPSChange("+args.join(', ')+")");
}

onConnectionStatus(status, recorderId);

Description: Called by the Pipe desktop client for every connection event

Passed Parameters:
status - the actual connection status: (connected, rejected, invalid app, closed, failed)
recorderId - variable sent via flash vars

Example:

function onConnectionStatus(status, recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onConnectionStatus("+args.join(', ')+")");
}

onMicActivityLevel(recorderId, currentActivityLevel);

Description: Called by the Pipe desktop client every 10th of a second (100 miliseconds) for perfect accuracy

Passed Parameters:
recorderId - variable sent via flash vars
currentActivityLevel - The amount of sound the microphone is detecting

Example:

function onMicActivityLevel(recorderId, currentActivityLevel){
	var args = Array.prototype.slice.call(arguments);
	alert("onMicActivityLevel("+args.join(', ')+")");
}

onSaveOk(streamName, streamDuration, userId, cameraName, micName, recorderId, audioCodec, videoCodec, fileType, videoId, audioOnly);

Description: The recording data has been fully uploaded (streamed) to our servers for further processing. This is not a confirmation that the recorded file is ready for delivery as the recording will take a few seconds to be processed (conversion to .mp4, snapshot extraction, rotation, push to storage location). Use Pipe's webhooks to be notified when the recording is fully processed and ready for delivery.

Passed Parameters:
streamName - a string representing the name of the stream WITHOUT the filename extension (.flv , .f4v or .mp4)
streamDuration - the duration of the recorded video/audio file in seconds but accurate to the millisecond (like this: 4.322)
userId - variable sent via flash vars
cameraName - the name of the webcam driver the user has selected for capturing video data
micName - the name of the sound card/mic driver the user has selected for capturing audio data
recorderId - variable sent via flash vars
audioCodec - the audio codec used for the recording, Nelly Moser ASAO or Speex
videoCodec - the video codec used for the recording, Sorenson or H.264
fileType - the format in which the resulting recording will be saved in: FLV, F4V or MP4
videoId - a string representing the recording id in Pipe's database (same recording id that is sent through the webhook) audioOnly - true if it is an audio only recording, false otherwise

Example:

function onSaveOk(streamName, streamDuration, userId, cameraName, micName, recorderId, audioCodec, videoCodec, fileType, videoId){
	var args = Array.prototype.slice.call(arguments);
	alert("onSaveOk("+args.join(', ')+")");
}

onRecorderReady(recorderId, recorderType);

Description: The Pipe recorder is ready to start recording videos(the interface has been built, you have allowed access to your webcam and you can see yourself in the browser)

Passed Parameters:
recorderId - variable sent via flash vars
recorderType - a string representing the type of the recorder (flash or HTML5).

Example:

function onRecorderReady(recorderId, recorderType){
	var args = Array.prototype.slice.call(arguments);
	alert("onRecorderReady("+args.join(', ')+")");
}

onFlashReady(recorderId);

Description: onFlashReady(recorderId); is called when the recording UI has been built (after clicking "Record Video or Record Audio" on both the initial screen and on the camera/mic selection screen which shows up if you have more than 1 cam/mic) and Flash is ready to accept calls to the JS Control API from HTML/JS

Chrome pausing Flash animations to save battery life

Chrome will intelligently pause Flash content to save battery life.

This applies to smaller Pipe embeds too.

When Pipe is paused by Chrome, onFlashReady will be called, while the Pipe recorder is apparently paused, if these 2 conditions are met:

  1. skip initial screen is on (sis:1 in the embed code)
  2. the user has only 1 webcam and 1 microphone

In this scenario onFlashReady will be called while the Pipe recorder is apparently paused.

If the user has also previously checked [ ] Remember in FP's Privacy panel onCamAccess will be called, followed by onFlashReady, while the Pipe recorder is apparently paused.

Here's how Pipe looks when it's paused by Chrome:

Use 400x300px size or bigger for Pipe embeds to prevent it from being paused by Chrome.

Passed Parameters:
recorderId - variable sent via flash vars

Example:

function onFlashReady(recorderId){
	var args = Array.prototype.slice.call(arguments);
	alert("onCamAccess("+args.join(', ')+")");
}

JavaScript Events API (Mobile)


onVideoRecorded(filename,filetype, audioOnly);

Description: Recording is done and it was selected for upload.

Passed Parameters:
filename - the automatically generated name of the recording
filetype - the format in of the original recording:MP4, MOV or 3GP audioOnly - true if it is an audio only recording, false otherwise

Example:

function onVideoRecorded(filename,filetype){
	var args = Array.prototype.slice.call(arguments);
	alert("onVideoRecorded("+args.join(', ')+")");
}

onClickUpload();

Description: Triggered when the upload button was pressed.

Passed Parameters: None

Example:

function onClickUpload(){
	var args = Array.prototype.slice.call(arguments);
	alert("onVideoRecorded("+args.join(', ')+")");
}

onVideoUploadSuccess(filename,filetype,videoId, audioOnly);

Description: Upload of the recording file finished successfully.

Passed Parameters:
filename - the automatically generated name of the recording
filetype - the format in of the original recording:MP4, MOV or 3GP
videoId - a string representing the recording id in Pipe's database (same recording id that is sent through the webhook) audioOnly - true if it is an audio only recording, false otherwise

Example:

function onVideoUploadSuccess(filename,filetype,videoId){
	var args = Array.prototype.slice.call(arguments);
	alert("onVideoUploadSuccess("+args.join(', ')+")");
}

onVideoUploadFailed(error);

Description: Upload of the recording file failed.

Passed Parameters:
error - The error thrown when the upload failed to complete

Example:

function onVideoUploadFailed(error){
	var args = Array.prototype.slice.call(arguments);
	alert("onVideoUploadFailed("+args.join(', ')+")");
}

Requirements and supported browsers


Pipe officially supports the following browsers.

On Desktop

  • Flash recorder:

    • Firefox 35 and up
    • Chrome 4 and up
    • Safari 4 and up
    • Internet Explorer 9 and up
    • Edge 12


  • HTML5 / recorder:

    • Chrome 52+ and Firefox 50+ on secure origins (https)

On Mobile:

  • Android Browser on Android version 4.4 and up
  • Safari on iOS version 6 and up

Pipe in different languages


Desktop

The Pipe desktop client UI defaults to English, supports 3 other languages and can also use a custom language loaded from an external language file hosted by you.

Pipe will auto-detect the preferred language setting of the browser in which it is run (using HTTP Accept Language Headers) and will use that language if available.

The Pipe desktop client supports the following languages: English (default), French, German and Spanish.

Mobile

The Pipe mobile client UI defaults to English and supports 3 other languages. Pipe will auto-detect the preferred language setting of the mobile OS in which it is run (using HTTP Accept Language Headers) and will use that language if available.

The Pipe mobile client supports the following languages: English (default), French, German and Spanish.

Using your own language file


The Pipe desktop & mobile recording clients allow you to use your own language file (XML file hosted your website) by linking directly to it, in the embed code, using the lang parameter.

Step 1: create your own language file and host it

Here is one of the default language files as an example: en.xml. Download it, translate the texts and upload it to your website.

Step 2: link to the new .xml file in your Pipe embed code

Setup the lang parameter to automatically load the .xml file through http or https depending on where Pipe is embedded. Here's an example code:

var flashvars = {qualityurl:"avq/720p.xml", lang: ('https:' == document.location.protocol ? 'https://' : 'http://') +"yourdomain.com/language_file.xml", accountHash:"your_account_hash", eid:1, showMenu:"true", mrt:5,sis:0,asv:1};

Step 3: allow Pipe to load the .xml file from your website

In order for Pipe to be able to load your custom .xml language file, you will need to do the following:

  1. Create a crossdomain.xml policy file (necessary for the Flash client) and put it in the root of your website. Here is the cross domain policy file that allows Pipe to load language files from your website:
    <cross-domain-policy>
    <allow-access-from domain="*.addpipe.com"/>
    </cross-domain-policy>
    Put the code above in a text file named crossdomain.xml. It should be acessible at http://yourwebsite.com/crossdomain.xml.
  2. Enable CORS on the server on which you are hosting the custom .xml language file (necessary for the HTML5 and Mobile client). For example on Apache, one of the most commonly used webservers, to add the CORS authorization to the header you must simply add the following line in either the Directory, Location, Files or VirtualHost sections of your server config (usually located in a *.conf file, such as httpd.conf or apache.conf), or within a .htaccess file:
    Header set Access-Control-Allow-Origin "*"
    For more details on how to configure CORS on other servers see https://enable-cors.org/server.html

Differences between HTML5 client and the Flash one


In the 2nd half of 2016 we've started working on our new HTML5 recording client and infrastructure. The 1st beta was released in December 2016. The table below documents the most important differences between the new HTML5 based solution and the old Flash based solution.

HTML5 Flash
Video and picture quality Uses the resolution specified in the loaded quality profile. The maximum possible picture quality of the webcam will be used and the bitrate will directly depend on this. Since the recorded data can be higher than the available bandwdith an upload screen might appear after the recording is stopped. Uses both the resolution and picture quality specified in the loaded quality profile. Since the recorded data can be higher than the available bandwdith an upload screen might appear after the recording is stopped. See Video quality options in Pipe.
Buffering mechanism Buffers the audio & video data locally allowing for high quality recordings over slow connections. Buffers the audio & video data locally allowing for high quality recordings over slow connections.
Initial video codecs VP8 H.264
Initial audio codecs Opus Nelly Moser ASAO
Requirements Chrome 52+ and Firefox 50+ on pages delivered over https. See Requirements and supported browsers.
Permissions needed in browser Chrome or Firefox camera and microphone access. Flash Player's camera and microphone access + Chrome or Firefox camera and microphone access.
Connection process The client directly connects through HTTPS to the media server over port 443/TCP. The client directly connects through RTMPS to the media server over port 443/TCP.

Differences in JavaScript Events API

With the exception seen in the table below, the JS events API has complete parity.

Flash HTML5
onFlashReady onFlashReady
userHasCamMic userHasCamMic
btRecordPressed btRecordPressed
btStopRecordingPressed btStopRecordingPressed
btPlayPressed btPlayPressed
btPausePressed btPausePressed
onUploadDone onUploadDone
onCamAccess onCamAccess
onPlaybackComplete onPlaybackComplete
onRecordingStarted onRecordingStarted
onConnectionClosed onConnectionClosed
onFPSChange onFPSChange
onConnectionStatus onConnectionStatus
onMicActivityLevel onMicActivityLevel
onSaveOk onSaveOk
onRecorderReady onRecorderReady
onRecorderInit onRecorderInit

Differences in JavaScript Control API

The JS control API has complete parity.

Flash HTML5
record record
stopVideo stopVideo
playVideo playVideo
pause pause
save save
getStreamTime getStreamTime
getPlaybackTime getPlaybackTime
getStreamName getStreamName

Record audio only


How to enable it

From the UI

You can easily enable Pipe to record audio only:

  1. Sign into your account
  2. Go to the Embed Recorder page
  3. On the left in the Options panel select [Record audio only]
  4. Click Generate Embed Code
  5. Copy and paste the newly generated code in your website


From code

Alternatively you can also add the new parameter ao and set it to 1 in your existing embed code like so:

How it looks

Once audio only recording is enabled the recorder will look as follows:

On Desktop



On Mobile


Support

On Desktop

Both the HTML 5 and Flash recorders support audio only recording.

On Mobile Android Devices

Recording just audio from Android devices is supported.

On Mobile iOS Devices

It is not possible to record just audio from iOS devices at this time because Safari on iOS does not support audio capture through the HTML Media Capture standard. When asked to record only audio it will give the user the (wrong) option to record a video or take a picture. The latest we've tested is iOS 11.1 .

By looking at our (video recording) data for September 2017 we determined only 0.4% of all recordings were recorded from iOS, the rest were recorded from Android (9.6%) and from desktop devices (90%).

Audio Recording Quality

On Desktop

  • The Flash client will record audio using NellyMoser's ASAO codec at 44.1 kHz in a .flv container. This is converted to AAC at 44.1 kHz in an .mp4 file.
  • The HTML5 client will record audio using Opus codec at 48 kHz in a .webm container. We convert it to AAC at 48 kHz in an .mp4 file.

On Mobile

When recording audio from mobile devices a wide range of containers and audio codecs will be used depending on the device and Android version. As of now the following codecs and containers are supported.

Container Audio Codec
mp3 mp3
m4a aac
3gp amr-nb
3gpp amr-nb
3gpp2 amr-nb
aac aac

All of them are converted to .mp4 files with AAC while keeping the original sampling frequency.

Pipe API https://api.addpipe.com


The API allows any user with an addpipe.com account to request information from our servers programmatically and in a standardized manner, using JSON.

Using the API Key

The API Key can be found in your Account Settings and it should be kept in a safe place, like any other password. If compromised, a new API key can be generated automatically from your Account Settings.

Authentication will be made with the custom header X-PIPE-AUTH, followed by your Api Key.

API endpoints

/video

Perform actions on active videos from your account.

    Parameters
  • all, optional. May be included or omitted from the request.

Requests available:
  • GET https://api.addpipe.com/video/all - get all videos from your account. JSON response
/video/:id

Perform actions for a specific video.

    Parameters:
  • :id - numerical representation of the video ID which can be found in your AddPipe account, under the Recorded Videos tab.

Requests available:
  • GET https://api.addpipe.com/video/167895864 - get specific information for this recording id JSON response
  • DELETE https://api.addpipe.com/video/167841 - deletes the recording with this id
/account

Perform actions on your account.


Requests available:
  • GET https://api.addpipe.com/account - get information regarding your AddPipe.com account JSON response
  • PUT https://api.addpipe.com/account - update your account information following the below JSON scheme
For PUT requests, make sure you send at least one of the following:
{
  "subscribed": "1"
}                       
/environment

Access environment related information.


Requests available:
  • GET https://api.addpipe.com/environment - get information regarding your AddPipe.com environments JSON response
/environment/:id

Get details about a specific environment.

    Parameters:
  • :id - numerical representation of the environment unique ID which can be retrieved by using the GET /environment endpoint

Requests available:
  • GET https://api.addpipe.com/environment/1537 - get specific information for this environment id JSON response
/webhook

Access webhook related information.


Requests available:
  • GET https://api.addpipe.com/webhook - get information regarding your Webhooks JSON response
/webhook/:id

Perform actions for a specific webhook.

    Parameters:
  • :id - numerical representation of the webhook ID which can be retrieved by using the GET /webhook endpoint.

Requests available:
  • PUT https://api.addpipe.com/webhook/69 - update your webhook by following the below JSON scheme
For PUT requests, make sure you send at least one of the following:
{	
  "webhook": "http://your-fancy-website.com/webhook",
  "webhook_recorded": "0",
  "webhook_transcoded": "1",
  "webhook_copied_s3": "0",
  "webhook_copied_ftp": "0",
  "webhook_copied_dbox": "0",
  "env_id":"2"
}                           
/amazon

Perform actions on your Amazon related information stored with AddPipe.


Requests available:
  • GET https://api.addpipe.com/amazon - get information regarding your Amazon credentials JSON response
/amazon/:id

Perform actions for a specific Amazon S3 credentials set.

    Parameters:
  • :id - numerical representation of the Amazon S3 credentials ID which can be retrieved by using the GET /amazon endpoint.

Requests available:
  • PUT https://api.addpipe.com/amazon/69 - update your Amazon credentials following the below JSON scheme
For PUT requests, make sure you send at least one of the following:
{
  "amz_key": "YourAmazonKey",
  "amz_secret": "YourAmazonSecret",
  "amz_bucket": "TheBucket",
  "amz_bucket_region": "AndTheRegion",
  "env_id": "1"
}                       
/ftp

Perform actions on your FTP/SFTP related information stored with AddPipe.


Requests available:
  • GET https://api.addpipe.com/ftp - get information regarding your (S)FTP credentials JSON response
/ftp/:id

Perform actions for a specific (S)FTP credentials set.

    Parameters:
  • :id - numerical representation of the (S)FTP credentials ID which can be retrieved by using the GET /ftp endpoint.

Requests available:
  • PUT https://api.addpipe.com/ftp/69 - update your (S)FTP credentials following the below JSON scheme
For PUT requests, make sure you send at least one of the following:
{
  "ftp_host": "FtpHost",
  "ftp_port": "21",
  "ftp_username": "FtpUsername",
  "ftp_password": "FtpPass",
  "ftp_dir": "/dir/to/saved_videos",
  "sftp_host": "SftpHost",
  "sftp_port": "22",
  "sftp_username": "SftpUser",
  "sftp_password": "SftpPass"
  "sftp_dir": "/dir/to/saved_videos",
  "env_id": "1"
}                       
/dropbox

Perform actions on your Dropbox related information stored with AddPipe.


Requests available:
  • GET https://api.addpipe.com/dropbox - get information regarding your Dropbox credentials JSON response
/dropbox/:id

Perform actions for a specific Dropbox credentials set.

    Parameters:
  • :id - numerical representation of the Dropbox credentials ID which can be retrieved by using the GET /dropbox endpoint.

Requests available:
  • PUT https://api.addpipe.com/dropbox/69 - update your Dropbox credentials following the below JSON scheme
For PUT requests, make sure you send at least one of the following:
{
  "dbox_token": "YourDropboxToken",
  "dbox_folder": "YourDropboxFolder",
  "env_id": "1"
}                       

Code Examples

PHP


$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{
  "amz_key": "",
  "amz_secret": "",
  "amz_bucket": "",
  "amz_bucket_region": ""
  "env_id": "1"
}');

$request->setRequestUrl('https://api.addpipe.com/amazon');
$request->setRequestMethod('PUT');
$request->setBody($body);

$request->setHeaders(array(
  'cache-control' => 'no-cache',
  'content-type' => 'application/json',
  'x-pipe-auth' => 'your-Pipe-Api-Key'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

cURL


curl -X PUT -H "X-PIPE-AUTH: Your-Pipe-Api-Key" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H -d '{
  "amz_key": "",
  "amz_secret": "",
  "amz_bucket": "",
  "amz_bucket_region": "",
  "env_id": "1"
}' 'https://api.addpipe.com/amazon'

JavaScript


var data = JSON.stringify({
  "amz_key": "",
  "amz_secret": "",
  "amz_bucket": "",
  "amz_bucket_region": ""
  "env_id": "1"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("PUT", "https://api.addpipe.com/amazon");
xhr.setRequestHeader("x-pipe-auth", "Your-Pipe-Api-Key");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("cache-control", "no-cache");

xhr.send(data);

Go


package main

import (
	"fmt"
	"strings"
	"net/http"
	"io/ioutil"
)

func main() {

	url := "https://api.addpipe.com/amazon"

	payload := strings.NewReader("{\n  \"amz_key\": \"\",\n  \"amz_secret\": \"\",\n  \"amz_bucket\": \"\",\n  \"amz_bucket_region\": \"\"\, \n  \"env_id\": \"1\"n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("x-pipe-auth", "Your-Pipe-Api-Key")
	req.Header.Add("content-type", "application/json")
	req.Header.Add("cache-control", "no-cache")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Python


import http.client

conn = http.client.HTTPConnection("api.addpipe.com")

payload = "{\n  \"amz_key\": \"\",\n  \"amz_secret\": \"\",\n  \"amz_bucket\": \"\",\n  \"amz_bucket_region\": \"\",\n  \"env_id\": \"1\"\n}"

headers = {
    'x-pipe-auth': "Your-Pipe-Api-Key",
    'content-type': "application/json",
    'cache-control': "no-cache"
    }

conn.request("PUT", "/account", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

Ruby


require 'uri'
require 'net/http'

url = URI("https://api.addpipe.com/amazon")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["x-pipe-auth"] = 'Your-Pipe-Api-Key'
request["content-type"] = 'application/json'
request["cache-control"] = 'no-cache'
request.body = "{\n  \"amz_key\": \"\",\n  \"amz_secret\": \"\",\n  \"amz_bucket\": \"\",\n  \"amz_bucket_region\": \"\", \n  \"env_id\": \"1\"\n}"

response = http.request(request)
puts response.read_body

Bash (wget)


wget --quiet \
  --method PUT \
  --header 'x-pipe-auth: Your-Pipe-Api-Key' \
  --header 'content-type: application/json' \
  --header 'cache-control: no-cache' \
  --body-data '{\n  "amz_key": "",\n  "amz_secret": "",\n  "amz_bucket": "",\n  "amz_bucket_region": "", \n  "env_id": "1"\n}' \
  --output-document \
  - https://api.addpipe.com/amazon

Bash (cURL)


curl --request PUT \
  --url https://api.addpipe.com/amazon \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --header 'x-pipe-auth: Your-Pipe-Api-Key' \
  --data '{\n  "amz_key": "",\n  "amz_secret": "",\n  "amz_bucket": "",\n  "amz_bucket_region": "", \n  "env_id": "1"\n}'