Pando Developer Toolkits

Pando provides a wide range of integration options. This allows developers to easily integrate the Pando platform into web sites, desktop applications, and even content management systems.

Pando Protocol URL's allow web sites and applications to easily trigger actions within Pando. For example, a web site can provide one-click subscription to Pando RSS feeds, or an application can have users send large files in using Pando.

The RSS Feed Converter makes it easy for podcasters to use Pando RSS without doing any engineering.

The Pando Web Services allow web sites and applications to present dynamic information about Pando packages, and to format presentation to suit each site.

The Pando Automation Toolkit allows desktop applications to integate Pando. For example, a chat program can use Pando to transfer large files through chat sessions, or a photo organizer could allow users to send photo albums using Pando.

There are two more complex API's, the Pando Client Integration Toolkit and the Pando Server Integration Toolkit that are available for deeper integrations.

Pando Protocol URLs

One of the simplest tools web and other developers can use to integrate Pando with a web site or application is the Pando "protocol." With simple links beginning with pando: (similar to "normal" links beginning with http:), the Pando client can be invoked for a number of simple actions.

Pando Package URL's


Pando provides two mechanisms for web sites and applications to trigger downloading Pando packages. The first is to link to a Pando Package URL, and the second is to open a pando:download URL.

Open Pando Package URL

The easiest way to provide links triggering Pando downloads is to simply open the Pando Package URL.

This method will first check whether the user has Pando installed.

If Pando is installed, the download will automatically start.

If Pando is not installed, the web browser will display a web page that will inform the user that they need to install Pando and help them with the process. Once installation is complete, the download of the desired package will automatically start.

Examples

The link can be presented as a simple HTML link. For example:

<a href="http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
CNN: In Case you Missed It for February 12, 2007</a>.

This looks like: CNN: In Case you Missed It for February 12, 2007.

If you like, you can use this download button:

CNN: In Case you Missed It for February 12, 2007<br />
<a href="http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
<img src="http://rss.pando.com/themes/rssvideo/pando_dl_button2.png">
</a>.

This looks like:
CNN: In Case you Missed It for February 12, 2007

The links can be used in RSS enclosures, so that Pando can subscribe to the RSS feed as a Channel.

pando:subscribe

The pando:subscribe URL allows users to subscribe to a Pando RSS feed with one click. These links have the following format where RSS URL is the URL to the RSS feed containing Pando packages:

pando:subscribe?RSS URL

We also support authenticated RSS feeds. These are feeds that require a username and password to access, such as those provided by paid content services, or web sites that require registration for access. A link to an authenticated RSS feed looks like this:

pando:subscribe?http://username:password@RSS URL

When clicked, the Pando client will attempt to subscribe to the linked RSS feed. See Creating a Pando RSS Feed for more information on creating Pando RSS feeds. You may also be interested in the RSS Feed Converter, for converting your existing Podcast to Pando RSS format.

Example

Pando provides an RSS feed of video's that we we find interesting, at http://rss.pando.com/rss.xml. We also publish "Pando enabled" versions of other rich media feeds, which are listed in our Podcast Gallery. To provide a link on a web page to allow Pando users to subscribe to the first feed with one click:

<a href="pando:subscribe?http://rss.pando.com/rss.xml">
<img src="http://rss.pando.com/themes/rssvideo_customized/PandoSubscribe.png">
<a>

This looks like:

Feel free to use the above graphic, so that Pando users will be able to spot your feed easily.

Authenticated Example

A web site has paid registration for access to premium content, which they make available via Pando RSS. When a user is logged into their web site, they display a "subscribe using Pando" link that allows for one-click subscription to the premium content. The HTML could look like:

<a href="pando:subscribe?laird:secret@http://www.contentsite.com/premium.xml">
<img src="http://rss.pando.com/themes/rssvideo_customized/PandoSubscribe.png">
<a>

This looks like:

The RSS server would need to be configured to use the web site's registration system so that it requires HTTP Basic Authentication for access to the RSS feed, and authenticates against the database of registered web site users. The details of this configuration is specific to the web site's registration and content systems.

Supported Versions

pando:subscribe links are supported in Pando version 0.9.3 and newer.

Authenticated pando:subscribe links are supported in Pando version 1.5.5.5 and newer.

Creaating Pando RSS feeds

pando:send

The pando:send URL tells Pando to open a Send window. If provided, it will auto-fill the email address and local files so that the user can review the information and send it. It can be used by either web sites or applications.

pando:send?email_address=submissions@videosite.com&files_to_send=c:\Cover.JPG,c:\Video.avi

Both email_address and files_to_send are optional. If they are not provided, they are left blank for the user to fill in. This provides you with the flexibility for many uses:

  • Send a set of files using Pando, with the user entering the recipient email address
  • Have the user pick a file or collection of files to send to you
  • You provide the files and the recipient address, and the user approves packaging and uploading

The pando:send URL's can be used from either a web site or an application.

Example: Web Site

For example, a web site may want users to send video files to the site using Pando. It could do so by giving a single 'submissions' email address, like this:

pando:send?email_address=submissions@videosite.com

This would open Pando's Send New window, pre-filled to send a package to submissions@videosite.com. The user would simply add the video, and click send. This is much simpler for users than launching Pando, clicking "Send Now", and copying and pasting the email address.

Sample HTML

To provide a link on a web page to allow people to send using Pando, here is a sample HTML:

<a href="pando:send?email_address=submissions@videosite.example.com"><img src="http://www.pando.com/files/Pando-Me-Button.png"></a>

This looks like:

We recommend that web sites use the above graphic, so that Pando users will be able to tell that you support Pando more easily.

Example: Web Site with Uploader Accounts

The web site could choose to generate a unique email address for each sender to use, and to implement an automated email processing facility. This is a technique commonly used on photo hosting web sites to allow people to send photo's securely from camera-phones (so that other people can't post photos to your web site). Similarly, this technique would allow people to use Pando to send files into their personal web sites. In this case, the URL would be similar to the above, but with a unique user ID, like this:

pando:send?email_address=12345678@submissions.videosite.com

If you are interested in integrating Pando deliveries into your workflow, you should contact us to discuss the Pando Server Integration Toolkit.

Example: Application

An application that is used to create or organize rich media files (such as a photo organizer, a video editor, etc.) may want to make it easy for users to send the result of their work using Pando. This can be done by adding a button to the application to "Send using Pando" that opens a pando:send URL. This will cause Pando to launch (if it is not already running), and to prepare the sending.

For example, if a video editing application added a "send using Pando" command to its GUI, it could attach the files to Pando by opening an URL like:

pando:send?files_to_send=c:\Cover.JPG,c:\Video.avi

This would bring up a Send New window in Pando, with the cover art and video file pre-attached, so the user could enter the recipient's email address, name the package, and send it.

We recommend using this button: for sending using Pando, so that Pando users can easily recognize that your application supports Pando.

Sample Windows C++ Code

The following is an example of how a Windows application can open a URL. The application should construct the URL as defined above, and then execute the following with the desired URL replacing the italicized example URL:

ShellExecute(m_hWnd, NULL, "pando:send?files_to_send=c:\Cover.JPG,c:\Video.avi", NULL, NULL, SW_SHOWDEFAULT);

If the application wants to use Pando to package and upload the files, but manage the delivery of the Pando Package URL itself, it can do so using the Pando Client Automation Toolkit.

Supported Versions

pando:send links are supported in Pando version 1.4 and newer, Mac OS X and Windows. The files_to_send parameter may work on Mac 1.4, but the email_address parameter does not work in the current Mac version. This will be addressed in a future version of Pando.

pando:download (deprecated)

Pando:download URL

If you are certain that your users have Pando installed (such as if your application integrates Pando into its installation process), or users have been instructed to install Pando, opening a pando:download link allows your users to one-click download a package using Pando.

Note that if the user does not have Pando installed, either nothing will happen, or an error message will be displayed, depending on the user's operating system and browser settings. Thus, Pando recommends using Pando Package URL's for web links.

Pando one-click download URLs have the following format, where url is the URL to the Pando package:

pando:download?url

For example, the download link for the above package would be:

pando:download?http://cache.pando.com/soapservices/Package/package.pando?
   id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
   &key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

When clicked, this link tells Pando to download a package indicated by the Pando Package URL.

Examples

For the above Package URL, a one-click download link would look like:

<a href="pando:download?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
CNN: In Case you Missed It for February 12, 2007</a>.

This looks like: CNN: In Case you Missed It for February 12, 2007.

If you like, you can use this download button:

CNN: In Case you Missed It for February 12, 2007<br />
<a href="pando:download?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
<img src="http://rss.pando.com/themes/rssvideo/pando_dl_button2.png">
</a>.

This looks like:
CNN: In Case you Missed It for February 12, 2007

You can also use the Package Thumbnail URL to make an image link:

<a href="pando:download?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94">
<img src="http://cache.pando.com/soapservices/SendToWeb?action=thumbnail
&id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633"></a>

Which looks like:

Supported Versions

pando:download links are supported in Pando version 0.9.1 and newer.

Important Note

In many cases, using the default "Send-to-IM"-style package URL will provide a better user experience than using the pando:download links. When a user without Pando installed clicks on a pando:download link, nothing happens. When a user without Pando installed clicks on a "Send-to-IM"-style URL, they are sent to a web page explaining that they need Pando to download the package they clicked on and, in some cases, the package will begin downloading automatically upon a successful installation. In either case, users with Pando installed will be able to download the package.

pando:forward

The pando:forward can be used to allow Pando users to easily forward Pando packages.

Opening a pando:forward link causes Pando to open the Send Window, with the package information pre-populated. This is the same window that the user would see if they selected the package in the Pando GUI and clicked the "share" button.

The user can then select the recipient of the package, using all of the mechanisms supported by Pando, including email, web embed, etc.

Pando forward URLs have the following format, where url is the URL to the Pando package:

pando:forward?url

For example, the forward link for a sample package would be:

pando:forward?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633
&key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

When clicked, this link tells Pando to offer to forward the package.

Supported Versions
pando:download links are supported in Pando version 0.9.5 and newer.

Pando:stream

Pando provides a stream delivery mechanism that can be used to play files using a media player while it is being downloaded.

This mechanism is deprecated in favor of the Pando REST API, but is supported for compatibility.

There are two versions of this mechanism.

  • pando:stream starts downloading the package in streaming mode, downloading the package sequentially to disk.
  • pando:streamL starts downloading the package in streaming mode, opening the downloaded stream.

For example of pando:stream and pando:streamL:


pando:stream?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633&
key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

and


pando:streamL?http://cache.pando.com/soapservices/Package/package.pando?
id=5A4A7B2AE83E0AA3DAF066C28703C6F3132B0633&
key=3557F2AAD6CEAEC0FB6B1F1E19C7531A116A1C2B209554FC9343F2A6ED9DAC94

The behavior when opening a stream is:

  • Does not open the Pando GUI.
  • Starts downloading the package.
  • If opened with pando:streamL, opens the package as a stream.

Supported Versions
pando:stream links are supported in Pando version 1.7.0 and newer.

RSS Feed Converter

Pando offers a "feed converter" service that allows Podcasters to provide Pando RSS feeds generated from existing Podcasts without requiring any engineering. This service subscribes to your PodCast and automatically repackages your feed as a Pando RSS feed, which you can then promote on your web site. The advantages of Pando RSS feeds include:

This service is available by request. If you would like us to convert your Podcast to Pando RSS, please send email to laird@pando.com with "Pando RSS" in the subject line. Please provide the following information in your request:

While we can process pretty much any Podcast, you may want to read more details about the Pando RSS Feed Converter input format in order to take advantage of Pando's capabilities.

RSS Feed Converter Input Format

The Pando RSS Feed Converter is a tool that monitors an RSS "podcast" feed, automatically processing any enclosures and publishing the result as a Pando RSS feed. It can process a wide range of RSS "podcast" formats automatically.

Feed Setup

To set up Pando RSS Feed Convertor processing of an RSS feed, please provide the following:

  • Feed Name (optional string, displayed to users in directory and application. If not provided, defaults to the channel's "title" element from the RSS feed.)
  • Feed Description (optional string, displayed to users in directory. If not provided, defaults to the channel's "description" element from the RSS feed.)
  • Feed URL (RSS 2.0 feed, specification at http://blogs.law.harvard.edu/tech/rss)
  • Source URL (optional link to your web site)
  • Sender Name (optional string, displayed in application. If not provided, defaults to channel "title" element from RSS feed.)
  • Feed Thumbnail (optional graphic, 100x75 pixel PNG). Used as the default Package thumbnail for all feed items.
  • Maximum number of items to serve in the feed (e.g. 3).

Feed Contents

Channel Data

The Pando RSS Feed Converter can process a wide range of RSS formats. We take advantage of the following RSS 2.0 attributes:

The RSS feed includes the following information for the channel:

  • Channel Name. (Required string, displayed to users in directory and application.)
  • Channel Description. (Required string, displayed to users in directory.)

Item Data

The RSS feed includes the following information for each item:

  • title. This becomes the package title. Required.
  • description. This becomes the package description. Optional.
  • pubDate. This becomes the item's date in the RSS feed. Optional, but strongly encouraged.
  • enclosure. This is the file that is retrieved and Pando packaged. Items without enclosures are ignored.

Limitations: All extended characters are stripped out, so that all file and package names are "safe" for all operating systems. This means that "Resumé" would become "Resum". Because the Pando client cannot display it, HTML and other special formatting / markup is also removed.

Pando Web Services

Pando provides a variety of ways to retrieve dynamically information about Pando packages using standard web technologies. This section describes available web services and related tools, from how to construct a Pando package or thumbnail URL, to retrieving structure package metadata or using our Javascript API to display custom views of package information.

The web services that Pando provides are:

Pando Package URL


Every Pando package has a unique Package URL. The file at the URL is the Pando file for the package.

Anatomy of a Package URL

The URL to any Pando package has the following structure:

http://cache.pando.com/soapservices/package.pando?id=PackageID&key=PackageKey

The URL contains two unique pieces of information needed to retrieve the full package - a Package ID and an encryption key.

The Package ID is the unique identifier of the package, and can be used with the Package Info Web Service to return the package metadata from the Pando system (package title, file names, thumbnail, number of downloads, etc.).

The encryption key is required to decrypt the contents of the package. Pando never stores encryption keys. The only way that your recipients can decrypt the package is if you give them the key, which is contained in either a Pando file or a Pando Package URL.

Getting Package URL's

One way to generate this URL is to simply find a package in the "Sent" tab of the Pando client, highlight the package and type CTRL-C (on Mac Command-C) to copy the URL to your clipboard. For more on how to get Pando Package URL's see How to get a Pando Package URL. The resultant URL will look like this:

http://cache.pando.com/soapservices/package.pando?id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
  &key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2

What does it do?

The most common use of a Pando Package URL is to use on a web page (or email or instant message) as a link for users to click on. When a user clicks a link to a Package URL (Example Package URL link), the Pando server checks to see if the user has Pando installed (by looking for the Pando "installed" cookie). If Pando is installed, the user immediately downloads the Pando package. If Pando is not installed (or if the cookie is not set), the user will instead land on a page explaining that they need Pando in order to download the software (Example new user link).

Pando Package URL's are also used throughout the Pando Developer Toolkits, such as the Package Info Web Service, as the unique identifier of a package.

Package Thumbnail URL

The thumbnail image of a package can be accessed by retrieving it from the Package Thumbnail URL.

Anatomy of a Package Thumbnail URL

Like Package URLs, the Package Thumbnail URL is a specially structured URL, containing the Package ID:

http://cache.pando.com/soapservices/SendToWeb?action=thumbnail&id=PackageId

Example: image tag

If you know the Package ID, you can automatically generate an image tag. For example:

<img alt="Spring Street Art" title="Download Spring Street art with Pando"
   src="http://cache.pando.com/soapservices/SendToWeb?action=thumbnail
   &id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB">

Which looks like: Spring Street Art

Example: image link

Using both the Package Thumbnail URL and the Package URL, could wrap the image in a link to the package itself, like this:

<a href="http://cache.pando.com/soapservices/package.pando?
   id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
   &key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2">
   <img alt="Spring Street Art" title="Download Spring Street art with Pando"
      src="http://cache.pando.com/soapservices/SendToWeb?action=thumbnail
        &id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB"/>
</a>

Which looks like: Spring Street Art

How Pando Generates Thumbnails

For learn more about how Pando creates thumbnails, see Publish Pretty Pando Packages.

Package Info Web Service

Getting Package Info

With a given Package ID (and optionally, package key), metadata about Pando packages can be retrieved from the Pando system. Request URLs take the following form:

http://cache.pando.com/soapservices/SendToWeb?action=info&format=Format&id=PackageId&key=PackageKey

Format can be either "xml" or "json," which determines how the data you request will be returned. The information returned includes:

  • "static" package info (also stored in the package file itself)
    • package id (passed in the URL)
    • encryption key (optional; included only if passed in the URL). If the key is not provided, users cannot download the file from the Package URL, below.
    • package name
    • description
    • creation date, in RFC 822 format
    • packager name
    • thumbnail URL
    • package URL
    • total file size, in bytes
    • list of files, with count
  • "dynamic" package info (changes over time)
    • number of downloads (number of completed downloads for the torrent right now).
    • expiration date, in RFC 822 format; omitted if the torrent has infinite expiration
    • expired; true if the package has expired from Pando's servers, omitted otherwise.

Example: XML

So, for example, the XML encoded package info for a package can be retrieved from the following URL:

http://cache.pando.com/soapservices/SendToWeb?action=info&format=xml
  &id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
  &key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2

Which returns the following result (with the "files" list trimmed -- full result here).

<?xml version="1.0"?>
<packageInfo>
	<version>1.0</version>
	<packageId>5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB</packageId>
	<key>C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2</key>
	<title>Spring Street Art</title>
	<description>
		At 11 Spring St. some of NYC's best street artists have canvassed 
		(literally) the building with art that is sprayed/painted/glued on the 
		exterior and interior walls.
	</description>
	<creationDate>Sun, 17 Dec 2006 14:06:30 -0500</creationDate>
	<packager>Yaron Samid</packager>
	<thumbnailURL>http://services.pando.com/soapservices/SendToWeb?action=thumbnail
	&id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB</thumbnailURL>
	<packageURL>http://cache.pando.com/soapservices/Package/package.pando?
		id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
		&key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2
	</packageURL>
	<packageSize>187249946</packageSize>
	<files num="91">
		<file name="Spring Street Art/IMG_8277.jpg" size="2196499"/>
		[... trimmed ...]
		<file name="Spring Street Art/IMG_8367.jpg"size="2071726"/>
	</files>
	<downloads>55</downloads>
	<expirationDate>Sat, 12 Dec 2026 15:42:20 -0500</expirationDate>
</packageInfo>

Example: JSON

To retrieve a JSON encoded version of the same data, we simply ask for a different format in the URL:

http://cache.pando.com/soapservices/SendToWeb?action=info&format=json
  &id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
  &key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2

Which returns the following result (with the "files" list trimmed -- full result here).

{"version":"1.0",
"packageId":"5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB",
"key":"C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2",
"title":"Spring Street Art",
"description":"At 11 Spring St. some of NYC's best street artists have canvassed
  (literally) the building with art that is sprayed/painted/glued on
  the exterior and interior walls.",
"creationDate":"Sun, 17 Dec 2006 14:06:30 -0500",
"packager":"Yaron Samid",
"thumbnailURL":"http://services.pando.com/soapservices/SendToWeb?action=thumbnail
  &id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB",
"packageURL":"http://cache.pando.com/soapservices/Package/package.pando
  ?id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
  &key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2",
"packageSize":187249946,
"fileCount":91,
"files":[
  {"name":"Spring Street Art/IMG_8277.jpg","size":2196499},
  [... trimmed ...],
  {"name":"Spring Street Art/IMG_8367.jpg","size":2071726}],
"downloads":55,
"expirationDate":"Sat, 12 Dec 2026 15:42:20 -0500"}	

JavaScript Access: PandoAPI.js

The Pando JavaScript API (PandoAPI.js) provides access to the Pando Web Services for JavaScript code that is running inside a web browser.

To see an example of how to use PandoAPI.js, see Custom Package Previews with PandoAPI.js.

One important limitation of the Javascript XmlHttpRequest function (a cornerstone of AJAX) is that it does not allow a script to load the contents of a file from a domain other than the one on which the script is running. There are good reasons, from a security standpoint, that this limitation exists. There are many workarounds for this for sources you trust (e.g., proxying calls on your own server). We decided to experiment with a Javascript library that allows you to retrieve metadata from packages encoded in JSON without requiring server-side code, just client-side javascript.

The Pando Javascript API library is at http://cache.pando.com/soapservices/PandoAPI.js. To use it, you need to include it in your HTML document in the <head> section: <script src="http://cache.pando.com/soapservices/PandoAPI.js" type="text/javascript"></script>

PandoAPI.toString

The Pando Javascript API has three functions. The simplest (PandoAPI.toString) simply outputs the current version of the PandoAPI and is useful for debugging. For example,

<html>
  <head>
   <script src="http://cache.pando.com/soapservices/PandoAPI.js" type="text/javascript">
   </script>
  </head>
  <body>
   <script type="text/javascript">
     document.write(PandoAPI.toString());
   </script>
  </body>
</html>

This will output something like: PandoAPI vtrunk

PandoAPI.getPackageURL

The second function (PandoAPI.getPackageURL) is also simple. It requires the package id and key (and optionally accepts the gotPando parameter) and generates a Package URL.

<html>
  <head>
   <script src="http://cache.pando.com/soapservices/PandoAPI.js" type="text/javascript">
   </script>
  </head>
  <body>
   <script type="text/javascript">
    document.write(PandoAPI.getPackageURL('5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB',
      'C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2'));
   </script>
  </body>
</html>
This will output the URL to the package:
http://cache.pando.com/soapservices/Package/Package.pando?
	id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
	&key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2 
You may also set the optional gotPando parameter. By default, it is false. Setting it to true will generate a Package URL that will skip the usual "is Pando installed?" test, and simply deliver the package. For example, replacing the necessary line from the above example:
document.write(PandoAPI.getPackageURL('5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB',
  'C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2',
  true));
This will result in a URL that looks like
http://cache.pando.com/soapservices/Package/Package.pando?
	id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
	&key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2&hasPando=yes

Note: When a user follows such a link, the Pando services will attempt to set the Pando "installed" cookie.

getPackageInfo

The most powerful tool provided by this API is the PandoAPI.getPackageInfo function. It accepts as parameters the package ID, a callback function and the package key (optional). When called, this function writes another <script> tag into your document that makes available the package info in JSON format, and then calls the provided callback function to process this data. This example simply writes all the available package metadata directly into the page:
<html>
  <head>
  <script src="http://cache.pando.com/soapservices/PandoAPI.js" type="text/javascript"></script>
  </head>
  <body>
	<script type="text/javascript">
	function printPackageCallBack(packageInfo) {
 	  //print all the properties in the packageInfo object
	  for (var prop in packageInfo) 
		document.write(prop+': <em>'+packageInfo[prop]+'</em><br/>');
	}
		
	//the package id and key (replace with your own values)
	var packageId = '5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB'; 	
	var packageKey = 'C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2';

	//use the API to retrieve the package info - results are returned to the callback function
	PandoAPI.getPackageInfo(packageId,printPackageCallBack, packageKey);

	</script>

	</body>
</html>
The resultant output (with "files" trimmed) looks something like:
version: 1.0
packageId: 5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
key: C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2
title: Spring Street Art
description: At 11 Spring St. some of NYC's best street artists have canvassed (literally)
the building with art that is sprayed/painted/glued on the exterior and interior walls.
creationDate: Sun, 17 Dec 2006 14:06:30 -0500
packager: Yaron Samid
thumbnailURL: http://services.pando.com/soapservices/SendToWeb?action=thumbnail
  &id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
packageURL: http://cache.pando.com/soapservices/Package/package.pando?
  id=5AEDE982393976A10050F2EC7C20C3C5EFDE0BBB
  &key=C51E9F2767B6747A9C9841AF7EEB9CC0E967D5B37CEC05B8C9DF310A03958AD2
packageSize: 187249946
fileCount: 91
files: [object Object], ..., [object Object]
downloads: 55
expirationDate: Sat, 12 Dec 2026 15:42:20 -0500
Notice that the file metadata aren't listed. Each file is an object containing name and size properties. If we replace our callback function to just print out a file list, e.g.:
function printPackageCallBack(packageInfo) {
  files = packageInfo['files'];
  for (var file in files)
	document.write(files[file].name +' : '+ files[file].size +' bytes<br />');
}
We get a (trimmed) list of file names, with sizes in bytes:
Spring Street Art/IMG_8277.jpg : 2196499 bytes
Spring Street Art/IMG_8368.jpg : 2397601 bytes
Spring Street Art/IMG_8369.jpg : 2432566 bytes
  ...
Spring Street Art/IMG_8366.jpg : 2319711 bytes
Spring Street Art/IMG_8367.jpg : 2071726 bytes

Now go read Custom Package Previews with PandoAPI.js.

PandoAPI.hasPando

This method gives web sites outside of the pando.com domain limited access to the status of the pando.com "installed" cookie. It accepts a callback function as an argument. This callback function accepts one argument, which can be true or false. When you invoke PandoAPI.hasPando, it will call document.write and write a script into your page that runs the callback function with the value set to true or false. Your callback function decides what to do with this information. We recommend running this method in your page's section and then waiting until the page is fully loaded (i.e., window.onload) to make use of the results. Please see "Using PandoAPI.js Installed Cookie Check" for a detailed example.

Is Pando Installed?

Update: In most cases, the PandoAPI javascript method for detecting Pando's installed status would be preferable to this approach. Here is a detailed example using javascript.

In many cases, it's helpful to know whether a user has Pando installed or not, to determine what to display on a particular web page containing Pando downloads or channel subscriptions, for example; and to better explain to your sites visitors how to acquire Pando if they don't already have it.

The Pando "Installed" Cookie

For our own web sites, we use a browser cookie to track whether a user has Pando installed or not. This cookie gets set in a user's default browser when they install Pando, and is set to never expire. The cookie's key/name is "installed" and value is set to "yes"). Because this cookie is accessible to any pando.com URL, we can make use of it in many places. For example, when a user clicks a package URL, we look for the cookie and, if it's set, we send the user the Pando file. If it's not set, we redirect them to a page explaining how to installed Pando (example).

Unfortunately, because cookies can only be read by the domain that sets them (a good thing for security purposes), other web sites cannot tell if a user has Pando installed.

"Installed" Cookie Check Service

To get around this limitation, we've implemented a simple "installed" cookie checking service you may use to discover if your users have Pando installed. To use this service, you must redirect your users (using javascript or, preferably, a server side script) to the following URL: http://www.pando.com/installcheck/?returnURL=http://example.com/ where http://example.com is an URL on your server that can handle the resultant response.

When a user visits the above URL, the pando web server looks for the Pando "installed" cookie and redirects the user back to the specified returnURL with hasPando=yes or hasPando=no appended to the URL parameters. It is up to you to receive this response and handle it in a useful way. We recommend setting your own cookie to remember the result of this check, to minimize these redirect-heavy requests.

Caveat

It's important to note that this is an imperfect solution. If a privacy-minded user frequently clears her cookies or uses a browser other than her default, the "installed" cookie might not be set even when she has Pando installed. It is important to allow users a way around a cookie check and force the cookie to be set to cover these cases.

Pando Automation Toolkit

Pando makes it easy for applications to send packages using Pando. For example, a chat application can use Pando to send video files, or a photo organizer to use Pando to send photo albums to friends and family.

If you are interested in distributing Pando with your application, please contact us.

There are two integration options, opening a pando:send URL or making an automation call.

pando:send URL

The easiest mechanism is have your application add a button to send packages using Pando, where Pando does the actual sending (sending the email, send to web, etc.). See One-click Pando packages with pando:send for details and code examples.

This is supported on both Mac and Windows.

Sending via Automation API

If you want your application take care of the sending, such as through a private chat network, posting to a web site, or incorporating into your own emails, we provide PDEmailInterface COM. This allows your application to call Pando to package files, returning the Package URL for you to use.

When your application receives Pando packages, such as through a private chat network or web page, you simply open the file or URL and we'll take care of the rest of the download. For more details, see Downloading Pando Packages.

If you want to control the entire user experience, contact us about the Pando Client Integration Toolkit.

Supported Versions

PDEmailInterface COM is supported in Pando version 1.4.5 and newer, Windows only.

Identical functionality will be provided for Mac OS X by an AppleEvents API in a future release of Pando.

PDEmailInterface COM Object

The PDEmailInterface COM Object provides an interface allowing Windows applications to detect the presence of Pando and integrate Pando file sending.

Functions

The PDEmailInterface COM object provides the following functions:

SendLink

SendLink is used to have Pando package and upload a set of files. It returns the Pando Package URL, which can be sent by the application to recipients. For example, it can be sent via an instant messaging network. The call returns when Pando packaging is complete, which typically takes several seconds. Uploading will continue asynchronously until complete.


        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SendLink( 
            /* [in] */ ULONG hWndParent,
            /* [in] */ VARIANT *filePaths,
            /* [out] */ BSTR *url) = 0;

The arguments are:

hWndParent
parent window (always passed in COM calls).
filePaths
an array of file paths of the files to package.
url
the Pando Package URL.

SetPluginVersion

SetPluginVersion is called in order to identify the calling application.


        virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE SetPluginVersion( 
            /* [in] */ BSTR name,
            /* [in] */ BSTR version) = 0;

The arguments are:

name
The name of the application.
version
The version of the application.

Examples

Here are examples of using the PDEmailInterface COM object from C++ and Visual Basic. Note that the SendLink method is provided only by pando.PDEmailInterface version 2 or newer. Thus, if "pando.PDEmailInterface.2" cannot be created, either Pando is not installed or it must be upgraded.

C++

{
try {
    CComPtr pando;
    //the create object will fail if Pando is not installed
    if(SUCCEEDED(pando.CoCreateInstance(L"pando.PDEmailInterface.2")) && pando)
    {
        // use this to initialize the dialog with a set of files
        // Create a SAFEARRAY to hold the list of files //
        SAFEARRAY      *pArray;
        SAFEARRAYBOUND bounds;
        bounds.cElements = arrayFilenames.GetSize();
        bounds.lLbound   = 0;
        pArray = SafeArrayCreate(VT_BSTR, 1, &bounds);
        // Initialize the SAFEARRAY with the filenames //
        if(!pArray)
            break;

        for(long ii = 0; ii < arrayFilenames.GetSize(); ii++)
            //arrayFilenames is your array of filenames
            SafeArrayPutElement(pArray, &ii, CComBSTR(arrayFilenames[ii])); 
        VARIANT var;
        VariantInit(&var);
        var.vt = VT_ARRAY | VT_BYREF | VT_BSTR;
        var.pparray = &pArray;
        
        // You MUST set this to a unique value for Your Application
        pando->SetPluginVersion(CComBSTR("MyAppName"), CComBSTR(""));
        CComBSTR url;
        if (SUCCEEDED(pando->SendLink(m_hWnd, &var, &url)) SendLink(m_hWnd, NULL, &url)
        {
           //use the http:// url to the pando file 
           //prepend pando:download? to make it a Pando URL
        }
        VariantClear(&var);// for the file list
    }
}catch(...){}

}

Visual Basic

{
    Dim strPaths(1 To 3) As String
    Dim pandoPath As String
    strPaths(1) = "C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-006.jpg"
    strPaths(2) = "C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-011.jpg"
    strPaths(3) = "C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-018.jpg"
    Dim pds As Object
    Set pds = CreateObject("pando.PDEmailInterface.2")
    Dim strUrl As String
    'You MUST set this to a unique value for Your Application
    pds.SetPluginVersion "MyApplicationName", ""
    pds.SendLink MyForm.hWnd, strPaths, strUrl
    'strUrl is the http path to the .pando file
    'prepend pando:download? to create a Pando URL
    MsgBox strUrl
}

.Net


PDEmailInterface pandoAPI = new PDEmailInterfaceClass();
object strPaths = new string[] {
    @"C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-006.jpg",
    @"C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-011.jpg",
    @"C:\Documents and Settings\Paul\My Documents\My Pictures\dumbo\pod-018.jpg" };
// You MUST set this to a unique value for Your Application
pandoAPI.SetPluginVersion("MyApplicationName", "");
string strUrl;
pandoAPI.SendLink((uint)this.Handle, ref strPaths, out strUrl);
// strUrl is the http path to the .pando file
// prepend pando:download? to create a Pando URL
MessageBox.Show(strUrl);

Pando Client Integration Toolkit

Pando's technology can be linked into your applications, providing all of the capabilities of the Pando platform but giving you complete control over the user experience. For more information, fill out this feedback form, describing your interest in the Pando Client Integration Toolkit and we'll get back to you as soon as we can.

If you are a Pando partner, you can access documentation to integrate Pando into your installer, use the Pando REST API, or integrate Pando into web pages using the Pando JavaScript Library.

Pando Server Integration Toolkit

Pando's technology can be integrated into your server applications and workflow, providing all of the capabilities of the Pando platform. For more information, see the Pando Command Line documentation. To get access to the Pando Command Line, please fill out this feedback form, describing your application and how you envision working with Pando, and we'll get back to you as soon as we can.

Pando Command Line (PCL)

For generating or processing Pando packages from within scripts, Pando provides the Pando Command Line (PCL).

To access this tool, you will need to log in with your partner account.

If you would like access to this tool, and the documentation linked below, please register for an account on this web site, and fill out our Server Integration Toolkit request form or email me.

In the first section of this guide, we'll describe how to install PCL. This is where you can download the latest PCL binaries for Linux, Windows and Mac OS X.

Next we'll talk about how to run the PCL, allowing you to automate publishing and downloading content using Pando.

Finally, we provide an example script that uses pcl to automatically download packages from a given email address.