Pipeliner CRM Python SDKs API Documentation

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

Pipeliner API for Python supports Python 2.7 as well as Python 3.x and above. Querying in the Python library is very similar to our Rest services.

Download

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 dict.
getEntityPublic Retrieves dict of public entities.
getErrorCodes Retrieves the dictionary 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 Sets username and password for connection.
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)

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

List 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 Python:
  
 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

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

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

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

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

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

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 result = service.getCollections(teamPipelineID)
 print(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, dict 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 dict.

Throws

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

Example

 In Python:

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

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

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 dict of public entities.

Throws

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

Example

 In Python:

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 result = service.getEntityPublic(teamPipelineID)
 print(result)

getErrorCodes Method

Syntax

getErrorCodes(teamPipeline)

Parameters

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

Return value

Dictionary of API error codes.

Remarks

Retrieves the dictionary of API error codes.

Throws

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

Example

 In Python:

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 result = service.getErrorCodes(teamPipelineID)
 print(result)

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, dict O Params for requested entity. It could be string identical with HTTP params followed after '?' or dict. See example.

Return value

List of dictionaries 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 Python:

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 retVal = service.getFields(teamPipelineID, 'Contacts')
 print(retVal[0]['API_NAME'])

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

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 result = service.getServerAPIUtcDateTime(teamPipelineID)
 print(result)

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

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 result = service.getTeamPipelineUrl(teamPipelineID)
 print(result)

setCredentials Method

Syntax

setCredentials(username, password)

Parameters

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

Remarks

Sets username and password for connection.

setEntities Method

Syntax

setEntities(teamPipeline, entity, data, flag)

Parameters

Parameter Type Required Description
teamPipeline string M Name of team space to be used.
entity string M Name of object.
data list M List containing dictionary objects with created or updated fields.
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 Python:

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

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

setEntity Method

Syntax

setEntity(teamPipeline, entity, data)

Parameters

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

 # -*- coding: utf8 -*-
 from pipeliner_api import PipelinerRestApi

 username = 'API Token'
 password = 'API Password'
 team_pipeline = 'Team Pipeline ID'

 service = PipelinerRestApi(service_url)
 service.setCredentials(username, password)

 data = {'ID': 'PY-7FFFFFFF-12345678-1234-1234-1234-1234567890', 'FIRST_NAME': 'Todd'}
 result = service.setEntity(teamPipelineID, 'Contacts', data)
print(result)