Pipeliner CRM Ruby SDKs API Documentation

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

Pipeliner API for Ruby supports Ruby 2.0.0 and above. Querying in the Ruby library is very similar to our Rest services.

Download

Binaries Sources Version
PipelinerAPI-1.5.0.gem PipelinerAPI-1.5.0.rb 1.5.0

Dependencies

Name Version
json 1.8.1+

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

deleteEntities(teamPipeline, entity, data, flag=0)

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entity string M Name of object.
data array M Array with IDs to delete.
flag 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 with given primary key.

Throws

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

Example

 In Ruby:
    
 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

   service = RestApi.new(serviceUrl)
   service.setCredentials(username, password)

   entity_ids = ["PY-7FFFFFFF-12345678-1234-1234-1234-1234567890"] result = service.deleteEntities(teamPipelineID, "Contact", entity_ids) puts result

 end

deleteEntity Method

Syntax

deleteEntity(teamPipeline, entity, id)

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entity string M Name of object.
id 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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  entity_id = "PY-7FFFFFFF-12345678-1234-1234-1234-1234567890" result = service.deleteEntity(teamPipelineID, "Contacts", entity_id) puts result
 
 end

getCollections Method

Syntax

getCollections(teamPipeline)

Parameters

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

Return value

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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  result = service.getCollections(teamPipelineID) puts result

 end

getEntities Method

Syntax

getEntities(teamPipeline, entity, params="")

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entity string M Name of object.
params string, hash O Params for requested entity. It could be string identical with HTTP params followed after '?' or dict. See example.

Return value

Hash table with response body.

Remarks

Retrieves list of entities in Hash.

Throws

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

Example

 In Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  result = service.getEntities(teamPipelineID, "Contacts", {"limit" => 5, "filter" => {"FIRST_NAME": "Todd"}}) puts result

 end

getEntityPublic Method

Syntax

getEntityPublic(teamPipeline)

Parameters

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

Return value

Hash of collection names as keys and entity names as values.

Remarks

Retrieves hash of public entities.

Throws

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

Example

 In Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  result = service.getEntityPublic(teamPipelineID) puts result

 end

getErrorCodes Method

Syntax

getErrorCodes(teamPipeline)

Parameters

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

Return value

Hash of API error codes.

Remarks

Retrieves the hash of API error codes.

Throws

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

Example

 In Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  result = service.getErrorCodes(teamPipelineID) puts result

 end

getFields Method

Syntax

getFields(teamPipeline, entityName, params="")

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entityName string M Name of entity class or entity collection.
params string, hash O Params for requested entity. It could be string identical with HTTP params followed after '?' or dict. See example.

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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  retVal = service.getFields(teamPipelineID, "Contacts") puts retVal["API_NAME"]

 end

getServerAPIUtcDateTime Method

Syntax

getServerAPIUtcDateTime(teamPipeline)

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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  result = service.getServerAPIUtcDateTime(teamPipelineID) puts result

 end

getTeamPipelineUrl Method

Syntax

getTeamPipelineUrl(teamPipeline)

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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  result = service.getTeamPipelineUrl(teamPipelineID) puts result
 
 end

setCredentials Method

Syntax

setCredentials(username, password)

Remarks

API Password obtained from API Access in customers portal.

Example

 In Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)
  
 end

setEntities Method

Syntax

setEntities(teamPipeline, entity, data, flag=0)

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entity string M Name of object.
data Hash Array M Array with IDs to delete.
flag 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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  data = [{"ID" => "PY-7FFFFFFF-12345678-1234-1234-1234-1234567890", "FIRST_NAME" => "Todd"}] result = service.setEntities(teamPipelineID, "Contact", data) puts result

 end

setEntity Method

Syntax

deleteEntities(teamPipeline, entity, data, flag=0)

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entity string M Name of object.
data Hash M Hash 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 Ruby:

 require 'rubygems'
 require 'PipelinerAPI'

 class Example

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

  service = RestApi.new(serviceUrl)
  service.setCredentials(username, password)

  data = {"ID" => "PY-7FFFFFFF-12345678-1234-1234-1234-1234567890", "FIRST_NAME" => "Todd"} result = service.setEntity(teamPipelineID, "Contacts", data) puts result

 end