Unofficial Capsule CRM API Java Client
Java Scala HTML
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

capsulecrm-java Build Status

NOTE: this client library implements version 1 of the Capsule API. Deprecation warning - version 1 of the Capsule API will not be available after October 27, 2017.

Unofficial Capsule CRM API Java Client.

Depends on Async Http Client, Google Guava, XStream and Joda-Time. Development sponsored by Coen Education. Follow @analytically for updates.


Java 8 or later. A Capsule CRM account and token.

Using with Maven

Add this dependency to your project's POM file:


Using with SBT

Add this dependency to your project's build.sbt or project/Build.scala file:

libraryDependencies += "" % "capsulecrm-java" % "1.3.4"


Add an application.conf property file to your application's classpath with the Capsule CRM url and token. Capsule CRM users can find their API token by visiting My Preferences via their username menu in the Capsule navigation bar.

capsulecrm.token="<your token here>"

Google Custom Search Engine for your Capsule CRM contact's websites

If you need a Google Custom Search searching all websites of your contacts, see the gcse directory for a Play Framework application hosting custom search annotations files. Point Google Custom Search to a server hosting this application.

  • In gcse/conf/application.conf, change capsulecrm.url and capsulecrm.token to your Capsule CRM account details
  • In gcse/conf/application.conf, change gcs.label to your Custom Search Engine label.
  • Run the application by using the play run command, see here for more information.
  • Under Control panel > Advanced > Add annotations feed, add http://yourhost/cse/persons for all person annotations, or http://yourhost/cse/organisations for all organisation annotations.

See Hosting the Annotation Files Yourself for more details.


Start by importing the client package and the necessary classes:

import java.util.concurrent.Future;

import static;

Fetch all parties, change something and save - asynchronous:

Futures.addCallback(listenInPoolThread(CParty.listAll()), new FutureCallback<CParties>() {
    public void onSuccess(CParties parties) {
        for (CParty party : parties) {
            party.about = "...";

            if (party instanceof COrganisation) {
                COrganisation org = (COrganisation) party;

                // if it's an organisation, change it's name
       = "...";

            // save changes - blocking
            Response response =;
            if (response.getStatusCode() < 200 || response.getStatusCode() > 206) {
      "Failure saving party " + party + ", response " + response.getStatusCode() + " " + response.getStatusText());


Add a tag to a party:

party.add(new CTag("iamatag"));

Add a note to a party:

party.add(new CHistoryItem("hello I'm a note"));

Add a task to a party:

party.add(new CTask("do this in two days",;

Click here for more examples.



Licensed under the Apache License, Version 2.0.

Copyright 2011-2016 Mathias Bogaert.