Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pipedrive/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
from pipedrive.activities import Activities
from pipedrive.deals import Deals
from pipedrive.filters import Filters
from pipedrive.leads import Leads
from pipedrive.items import Items
from pipedrive.notes import Notes
from pipedrive.organizations import Organizations
from pipedrive.persons import Persons
from pipedrive.pipelines import Pipelines
from pipedrive.products import Products
from pipedrive.recents import Recents
from pipedrive.stages import Stages
from pipedrive.users import Users
from pipedrive.webhooks import Webhooks

Expand All @@ -29,13 +30,14 @@ def __init__(self, client_id=None, client_secret=None, domain=None):
self.activities = Activities(self)
self.deals = Deals(self)
self.filters = Filters(self)
self.leads = Leads(self)
self.items = Items(self)
self.notes = Notes(self)
self.organizations = Organizations(self)
self.persons = Persons(self)
self.pipelines = Pipelines(self)
self.products = Products(self)
self.recents = Recents(self)
self.stages = Stages(self)
self.users = Users(self)
self.webhooks = Webhooks(self)

Expand Down
5 changes: 5 additions & 0 deletions pipedrive/deals.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def get_deal_details(self, deal_id, **kwargs):
url = 'deals/{}'.format(deal_id)
return self._client._get(self._client.BASE_URL + url, **kwargs)

def search_deals(self, params=None, **kwargs):
url = 'deals/search'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)

#Deprecated, rather look at search_deals
def get_deals_by_name(self, params=None, **kwargs):
url = 'deals/find'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)
Expand Down
7 changes: 7 additions & 0 deletions pipedrive/items.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Items(object):
def __init__(self, client):
self._client = client

def get_item_search(self, params=None, **kwargs):
url = 'itemSearch'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)
27 changes: 27 additions & 0 deletions pipedrive/leads.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class Leads(object):
def __init__(self, client):
self._client = client

def get_lead(self, lead_id, **kwargs):
url = 'leads/{}'.format(lead_id)
return self._client._get(self._client.BASE_URL + url, **kwargs)

def get_all_leads(self, **kwargs):
url = 'leads'
return self._client._get(self._client.BASE_URL + url, **kwargs)

def create_lead(self, data, **kwargs):
url = 'leads'
return self._client._post(self._client.BASE_URL + url, json=data, **kwargs)

def update_lead(self, lead_id, data, **kwargs):
url = 'leads/{}'.format(lead_id)
return self._client._put(self._client.BASE_URL + url, json=data, **kwargs)

def delete_lead(self, lead_id, **kwargs):
url = 'leads/{}'.format(lead_id)
return self._client._delete(self._client.BASE_URL + url, **kwargs)

def get_lead_details(self, lead_id, **kwargs):
url = 'leads/{}'.format(lead_id)
return self._client._get(self._client.BASE_URL + url, **kwargs)
5 changes: 5 additions & 0 deletions pipedrive/organizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def get_organization_fields(self, params=None, **kwargs):
url = 'organizationFields'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)

def search_organizations(self, params=None, **kwargs):
url = 'organizations/search'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)

#Deprecated, rather look at search_organizations
def find_organization_by_name(self, **kwargs):
url = 'organizations/find'
return self._client._get(self._client.BASE_URL + url, **kwargs)
7 changes: 6 additions & 1 deletion pipedrive/persons.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def get_all_persons(self, params=None, **kwargs):
url = 'persons'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)

#Deprecated Enpoint, rather use /persons/search instead
def get_persons_by_name(self, params=None, **kwargs):
url = 'persons/find'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)
Expand All @@ -24,7 +25,7 @@ def update_person(self, person_id, data, **kwargs):

def delete_person(self, person_id, **kwargs):
url = 'persons/{}'.format(person_id)
return self._client._delete(url, **kwargs)
return self._client._delete(self._client.BASE_URL + url, **kwargs)

def get_person_deals(self, person_id, **kwargs):
url = 'persons/{}/deals'.format(person_id)
Expand All @@ -33,3 +34,7 @@ def get_person_deals(self, person_id, **kwargs):
def get_person_fields(self, params=None, **kwargs):
url = 'personFields'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)

def search_persons_by_term(self, params=None, **kwargs):
url = 'persons/search'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)
5 changes: 5 additions & 0 deletions pipedrive/products.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ def get_all_products(self, **kwargs):
url = 'products'
return self._client._get(self._client.BASE_URL + url, **kwargs)

def search_products(self, params=None, **kwargs):
url = 'products/search'
return self._client._get(self._client.BASE_URL + url, params=params, **kwargs)

#Deprecated rather use search_products
def get_product_by_name(self, **kwargs):
url = 'products/find'
return self._client._get(self._client.BASE_URL + url, **kwargs)
Expand Down