From d190673b0ae3d0272e379712dcf885b605f4167d Mon Sep 17 00:00:00 2001 From: Ape Toshi Date: Thu, 26 Oct 2023 20:28:41 +0200 Subject: [PATCH 1/3] Add add_follower_to_person --- pipedrive/persons.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipedrive/persons.py b/pipedrive/persons.py index ead4399..ce92945 100644 --- a/pipedrive/persons.py +++ b/pipedrive/persons.py @@ -37,3 +37,8 @@ def get_person_fields(self, params=None, **kwargs): def get_person_activities(self, person_id, **kwargs): url = "persons/{}/activities".format(person_id) return self._client._get(self._client.BASE_URL + url, **kwargs) + + def add_follower_to_person(self, person_id, user_id, **kwargs): + url = "persons/{}/followers".format(person_id) + data = {'user_id': user_id} + return self.client._post(self.BASE_URL+url, json=data, **kwargs) From f25b6f2fe904bf7afd13297179a3965514c95a45 Mon Sep 17 00:00:00 2001 From: Ape Toshi Date: Thu, 26 Oct 2023 20:33:47 +0200 Subject: [PATCH 2/3] Changed single to double quotes --- pipedrive/persons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipedrive/persons.py b/pipedrive/persons.py index ce92945..5d7f615 100644 --- a/pipedrive/persons.py +++ b/pipedrive/persons.py @@ -40,5 +40,5 @@ def get_person_activities(self, person_id, **kwargs): def add_follower_to_person(self, person_id, user_id, **kwargs): url = "persons/{}/followers".format(person_id) - data = {'user_id': user_id} + data = {"user_id": user_id} return self.client._post(self.BASE_URL+url, json=data, **kwargs) From ffd556ab3749f0da8db0c6f8e029a3a3b3ec2469 Mon Sep 17 00:00:00 2001 From: Ape Toshi Date: Thu, 26 Oct 2023 20:43:48 +0200 Subject: [PATCH 3/3] Add add_follower_to_organization --- pipedrive/organizations.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pipedrive/organizations.py b/pipedrive/organizations.py index fed3279..193d491 100644 --- a/pipedrive/organizations.py +++ b/pipedrive/organizations.py @@ -33,3 +33,8 @@ def search_organizations(self, params=None, **kwargs): def get_organization_persons(self, organization_id, params=None, **kwargs): url = "organizations/{}/persons".format(organization_id) return self._client._get(self._client.BASE_URL + url, params=params, **kwargs) + + def add_follower_to_organization(self, org_id, user_id, **kwargs): + url = "organizations/{}/followers".format(org_id) + data = {"user_id": user_id} + return self._post(self.BASE_URL+url, json=data, **kwargs)