Pipeliner CRM Java SDKs API Documentation

Read and use the Pipeliner CRM API to build integrations between Pipeliner CRM and other apps.

Pipeliner API for Java supports JDK 1.6 and above. However the library depends on other external libraries. Querying in the Java library is same as in our Rest services.

Download

Dependencies

Name Version
Apache Commons Codec 1.9
Java JSON -

Methods

Method Description
deleteEntities Deletes entities with given primary key.
deleteEntity Deletes entity with given primary key.
getCollections Retrieves list of collections in the pipeline.
getEntities Retrieves list of entities in Hash.
getEntityPublic Retrieves hash of public entities.
getErrorCodes Retrieves the hash of API error codes.
getFields Returns list of fields for specific entity.
getServerAPIUtcDateTime Retrieves the current server's UTC datetime for queried team space.
getTeamPipelineUrl Retrieves the datacenter URL for team space.
setCredentials API Password obtained from API Access in customers portal.
setEntities Creates a new entities. If ID is provided in data, then update is performed for existing entity.
setEntity Creates a new entity in collection. If ID is provided in data, then update is performed for existing entity.

deleteEntities Method

Syntax

 public java.lang.String[] deleteEntities(java.lang.String teamPipeline, java.lang.String entity, java.lang.String[] data, java.lang.Integer flag) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.
entity java.lang.String M Name of object.
data java.lang.String[] M Array with IDs to delete.
flag java.lang.Integer O The processing of command can be modified by combination of flags: FLAG_ROLLBACK_ON_ERROR[0] – if any error is occurred no entity will be processed, entire batch will be rollbacked and exception thrown. FLAG_IGNORE_ON_ERROR[1] – it any error occures for an entity , this entity is ignored and system continues with the next one. FLAG_GET_NO_DELETED_ID[4] - The method returns list of ID, which cannot be deleted. Could be used with combination with FLAG_IGNORE_ON_ERROR. FLAG_IGNORE_AND_RETURN_ERRORS[8] – if any error occurs for an entity, this entity is ignored and system continues with the next one.

Return value

Array of result for deleted entities.

Remarks

Deletes entities by provided keys.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String[] data = new String[]{"PY-7FFFFFFF-12345678-1234-1234-1234-1234567890"};
            String[] result = service.deleteEntities(teamPipeline, "Contact", data, 256); 
            System.out.println(result[0]);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

deleteEntity Method

Syntax

 public java.lang.String deleteEntity(java.lang.String teamPipeline, java.lang.String entity, java.lang.String id) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.
entity java.lang.String M Name of object.
id java.lang.String M The unique identificator of entity.

Return value

ID of deleted entity.

Remarks

Deletes entity with given primary key.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String id = "PY-7FFFFFFF-12345678-1234-1234-1234-1234567890"
            String result = service.deleteEntity(teamPipeline, "Contacts", id);
            System.out.println(result);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getCollections Method

Syntax

 public java.lang.String[] getCollections(java.lang.String teamPipeline) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.

Return value

String array of collections.

Remarks

Retrieves list of collections in the pipeline.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 in Java

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String[] result = service.getCollections(teamPipeline);
            for (int i = 0; i < result.length; i++) {
                System.out.println(result[i]);
            }
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getEntities Method

Syntax

 public JSONArray getEntities(java.lang.String teamPipeline, java.lang.String entity, java.lang.String query) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.
entity java.lang.String M Name of object.
params java.lang.String O Params for requested entity. Query is equal to params followed after '?'.

Return value

JSONArray with response body.

Remarks

Retrieves list of entities in string.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String result = service.getEntities(teamPipeline, "Contacts", "limit=5&filter=FIRST_NAME::Todd"); 
            System.out.println(result);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getEntityPublic Method

Syntax

 public JSONObject getEntityPublic(java.lang.String teamPipeline) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.

Return value

JSONObject with server API collections as keys and entity names as values.

Remarks

Retrieves the JSONObject list of public entities.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            JSONObject result = service.getEntityPublic(teamPipeline);
            System.out.println(result.getString("Accounts"));
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getErrorCodes Method

Syntax

 public JSONObject getErrorCodes(java.lang.String teamPipeline) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.

Return value

JSONObject with server API errors as keys and string of API error codes as values.

Remarks

Retrieves the JSONOBject list of API error codes.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            JSONObject result = service.getErrorCodes(teamPipeline);
            System.out.println(result.getString("119"));
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getFields Method

Syntax

 public JSONArray getFields(java.lang.String teamPipeline, java.lang.String entityName, java.lang.String query) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.
entityName java.lang.String M Name of entity class or entity collection.
query java.lang.String O REST query string for filtering (e.g. "filter=CUSTOM::TRUE")

Return value

JSONArray of JSONObjects which contains information about fields:

  • API_NAME - field name used in API as key.
  • CALC_FORMULA - calculated formula for autocalculated fields, or None if not set.
  • CHOICES - if dropdown or radio button, then dictionary is set with IDs of datasets as keys and their names as values, otherwise None is set.
  • CUSTOM - true if custom field, false if system field.
  • DEFAULT - default value for field. If not set, then None.
  • DESCRIPTION - description of field.
  • ID - unique identificator of field. Used as ID_FIELD in Data entity.
  • MAX_VALUE - max allowed value. For decimal types, it is maximal number, for unicode types it is maximal length of string.
  • MIN_VALUE - min allowed value for decimal an datetime types.
  • NAME - field name shown in Pipeliner.
  • PL_TYPE - Pipeliner field type.
  • READONLY - true if field is readonly, otherwise false.
  • REQUIRED - true if field is required, otherwise false.
  • TYPE - Type of field. Supported types - [string, unicode, datetime, long, Decimal, list]

Remarks

Returns list of fields for specific entity.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            JSONArray result = service.getFields(teamPipeline, "Contacts"); 
            System.out.println(result.getJSONObject(0).getString("API_NAME"));
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getServerAPIUtcDateTime Method

Syntax

 public java.lang.String getServerAPIUtcDateTime(java.lang.String teamPipeline) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.

Return value

Current server's UTC date as string.

Remarks

Retrieves the current server's UTC datetime for queried team space.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String result = service.getServerAPIUtcDateTime(teamPipeline);
            System.out.println(result);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

getTeamPipelineUrl Method

Syntax

 public java.lang.String getTeamPipelineUrl(java.lang.String teamPipeline) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.

Return value

Datacenter URL for current team space.

Remarks

Retrieves the datacenter URL for team space.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String result = service.getTeamPipelineUrl(teamPipeline);
            System.out.println(result);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

setCredentials Method

Syntax

 public void setCredentials(java.lang.String username, java.lang.String password)
  

Parameters

Parameter Type Required Description
username java.lang.String M API Token obtained from API Access in customers portal.
password java.lang.String M API Password obtained from API Access in customers portal.

Remarks

Sets username and password for connection.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        
    }
 }

setEntities Method

Syntax

 public java.lang.String[] setEntities(java.lang.String teamPipeline, java.lang.String entity, java.lang.String[] data, java.lang.Integer flag) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.
entity java.lang.String M Name of object.
data java.lang.String[] M Array with IDs to delete.
flag java.lang.Integer O The processing of command can be modified by combination of flags: FLAG_ROLLBACK_ON_ERROR[0] – if any error is occurred no entity will be processed ,entire batch will be rollbacked and exception thrown. FLAG_IGNORE_ON_ERROR[1] – it any error occures for an entity , this entity is ignored and system continues with the next one. FLAG_GET_NO_DELETED_ID[4] - The method returns list of ID, which cannot be deleted. Could be used with combination with FLAG_IGNORE_ON_ERROR. FLAG_IGNORE_AND_RETURN_ERRORS[8] – if any error occurs for an entity, this entity is ignored and system continues with the next one. FLAG_VALIDATE_ONLY_UPDATED_FIELDS[256] - flag will validate only updated fields in entity instead of all fields.

Return value

Array of results for requested entities.

Remarks

Creates a new entities. If ID is provided in data, then update is performed for existing entity.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String[] data = new String[]{"{\"ID\": \"PY-7FFFFFFF-12345678-1234-1234-1234-1234567890\", \"FIRST_NAME\":\"Richard\"}"}
            String[] result = service.setEntities(teamPipeline, "Contact", data); 
            System.out.println(result[0]);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }

setEntity Method

Syntax

 public java.lang.String setEntity(java.lang.String teamPipeline, java.lang.String entity, java.lang.String data) throws HTTPErrorException
  

Parameters

Parameter Type Required Description
teamPipeline java.lang.String M Name of team space to be used.
entity java.lang.String M Name of object.
data java.lang.String M Serialized JSON string with created or updated fields.

Return value

ID of created or updated entity.

Remarks

Creates a new entity in collection. If ID is provided in data, then update is performed for existing entity.

Throws

HTTPErrorException Raises on HTTP error code from server with API error message.

Example

 In Java:

 import com.pipelinersales.restapi.HTTPErrorException;
 import com.pipelinersales.restapi.RestAPI;
 import org.json.JSONArray;

 public class example {

    public static void main(String[] args) {

        String username = "API Token";
        String password = "API Password";
        String teamPipeline = "Team Pipeline ID";
        String serviceUrl = "Service URL";

        RestAPI service = new RestAPI(serviceUrl);
        service.setCredentials(username, password);

        try {
            String entity = "{\"ID\": \"PY-7FFFFFFF-12345678-1234-1234-1234-1234567890\", \"FIRST_NAME\":\"Richard\"}"
            String result = service.setEntity(teamPipeline, "Contacts", entity); 
            System.out.println(result);
        } catch (HTTPErrorException e) {
            e.printStackTrace();
        }
    }
 }