Desktop Applet

Begin Applet Import

This import method requires that your user grants our applet permission to access the contacts that are stored locally on her computer.

  1. Your application calls the /begin_import/desktop_applet endpoint, including the contact source requested.
  2. CloudSponge returns a result object, including a url for the desktop applet, which needs to be downloaded by the user and an import_id to be used to identify the import to the applet and to fetch the events and contacts.
  3. Your application directs the user’s browser to download the applet from the url provided. This is accomplished by inserting the url and import_id into the HTML snippet at the bottom of this section and rendering it onto the page.

Now your application should go to Step 2 while the user gives CloudSponge permission to access their address book and we download it for you.

Definition

POST https://api.cloudsponge.com/begin_import/desktop_applet[.format]

Request Arguments

NameRequired?Description
domain_keyYesYour domain key.
domain_passwordYesYour domain password.
serviceYesService code (click here)
includeNoBy specifying mailing_address here, mailing addresses will be returned in addition to the other contact information.
user_idNoAny unique identifier you use to identify a user. This value will be returned on calls to the /events and /contacts endpoints.
echoNoAny customer defined string data to be returned in the response.

Example Request

curl --user 33664218758c5244136965160db455db012b1411:Tpa01z+vVPE7MxXi \
     --request POST \
     --data "service=outlook" \
     --url "https://api.cloudsponge.com/begin_import/desktop_applet.json"

Response Variables

NameDescription
statussuccess or failure
urlJava applet URL to be used to process the import.
import_idThe identifier for this import, used in subsequent calls to fetch events and contacts.
user_idThe customer defined string that was passed in as an argument.
echoThe customer defined string that was passed in as an argument.

Example Response (JSON)

{  
  "status": "success",
  "url": "https://api.cloudsponge.com/objects/ContactsApplet_signed.jar",
  "import_id": 1126  
}

Example Response (XML)

<?xml version="1.0" encoding="UTF-8"?>
<result>
  <status>success</status>
  <url>https://api.cloudsponge.com/objects/ContactsApplet_signed.jar</url>
  <import-id>1126</import-id>
</result>

Insert the url and import_id values into the relevant spots in the HTML below and render it on your page to invoke the applet.

Please note Chrome no longer supports the Java browser plugin so when importing from Outlook or Mac OS X contact on Chrome, use the file upload or iCloud import instead.

<!--[if !IE]> Firefox and others will use outer object -->
<object classid="java:ContactsApplet"
  type="application/x-java-applet"
  archive="[ url ]"
  height="1"
  width="1">
  <!-- Konqueror browser needs the following param -->
  <param name="archive" value="[ url ]" />
  <param name="importId" value="[ import_id ]"/>
  <param name="cookieValue" value="document.cookie"/>
  <param name="MAYSCRIPT" value="true">
<!--<![endif]-->

  <!-- MSIE (Microsoft Internet Explorer) will use inner object -->
  <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase="http://java.sun.com/update/1.6.0/jinstall-6u30-windows-i586.cab"
    height="0"
    width="0" >
    <param name="code" value="ContactsApplet" />
    <param name="archive" value="[ url ]" />
    <param name="importId" value="[ import_id ]"/>
    <param name="cookieValue" value="document.cookie"/>
   <param name="MAYSCRIPT" value="true">

    <!-- Chrome falls through to this innermost applet -->
    <applet archive="[ url ]" code="ContactsApplet" height="1" width="1" MAYSCRIPT>
      <param name="importId" value="[ import_id ]"/>
      <param name="cookieValue" value="document.cookie" />
      <param name="MAYSCRIPT" value="true">
      <strong>
        This browser does not have a Java Plug-in.<br />
        <a href="http://java.sun.com/products/plugin/downloads/index.html">
          Get the latest Java Plug-in here.
        </a>
      </strong>
    </applet>
  </object>

<!--[if !IE]> close outer object -->
</object>
<!--<![endif]-->