Contact Importer for Java

Additionally to our simple widget integration,
CloudSponge offers an API for Java.

Get Started

Create your CloudSponge account and tell us your domain. If it’s your development environment you’ll get a CloudSponge Key for free.


If you’re using Maven, add to you pom.xml:


If you’re not using Maven, download the single jar or the jar with all included dependencies and add it your project.


CloudSpongeApiFactory factory = new CloudSpongeApiFactoryImpl("DOMAIN_KEY", "DOMAIN_PASSWORD");

CloudSpongeApi<UserConsent> cloudSponge = factory.create(ContactsService.GMAIL);
// For AOL use:
// final CloudSpongeApi<ImportResponse> cloudSponge = factory.create(ContactsService.AOL);
// cloudSponge.userName("me").userPassword("test").beginImport();

try {
  UserConsent consent = cloudSponge.beginImport();
  // Manually open the consent page in a browser window to continue with the import
  System.out.println("Copy and paste the following URL into your favorite browser to continue with the import:");

  // Waiting for consent...
  ProgressEvents progress = cloudSponge.getImportProgress();
  while (!progress.isDone()) {
    progress = cloudSponge.getImportProgress();

  Event completeEvent = progress.getEvent(EventType.COMPLETE);
  if (completeEvent.getStatus() == EventStatus.ERROR) {
    System.out.println("Error: " + completeEvent.getValue());
  } else {
    UserContacts userContacts = cloudSponge.fetchContacts();
    Contact owner = userContacts.getOwner();
    for (Contact contact : userContacts.getContacts()) {
} finally {

CloudSponge Proxy URL

The CloudSponge API Java Wrapper also includes an implementation of a Proxy URL for branding the user authentication process. For more the details, click here.

For using the Proxy URL Servlet, just add it to your web.xml file:

  <servlet-name>CloudSponge URL Proxy</servlet-name>
  <servlet-name>CloudSponge URL Proxy</servlet-name>

Other languages than Java

Don’t want to use Java? Not a problem! CloudSponge offers API for several languages:
PHPJavaRuby.NetColdFusion – or even a Do-It-Yourself Approach, which uses a REST API to return Contacts in JSON format.

Try CloudSponge for free in your
testing environment

Get Started

Have a questions or prefer a guided tour?
Schedule a consultation with our Founder.