From 80242e48cdf39b7974ef3e57ccec85f9c2049d0a Mon Sep 17 00:00:00 2001 From: Muhammad Shahid Date: Thu, 7 Nov 2019 15:20:30 +0500 Subject: [PATCH 1/2] Mailbox resource added --- src/Resources/Mailbox.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/Resources/Mailbox.php diff --git a/src/Resources/Mailbox.php b/src/Resources/Mailbox.php new file mode 100644 index 0000000..1d9f66a --- /dev/null +++ b/src/Resources/Mailbox.php @@ -0,0 +1,34 @@ +request->get('mailThreads/:id', compact('id')); + } + + /** + * Get list of mail threads + * + * @param $folder + * @param array $options + * @return Response + */ + public function mailThreads($folder, $options = []) + { + $options['folder'] = $folder; + + return $this->request->get('mailThreads', $options); + } +} \ No newline at end of file From 744715753e791fac733391ff2ff2c515c7be932e Mon Sep 17 00:00:00 2001 From: Muhammad Shahid Date: Thu, 7 Nov 2019 17:06:31 +0500 Subject: [PATCH 2/2] I have implemented this class to fetch mailThreads from PipeDrive API. The resource was not already present in the API client. The following end-points has been implemented. GET https://api.pipedrive.com/v1/mailbox/mailThreads?folder=inbox&start=0&limit=2&api_token=?? GET https://api.pipedrive.com/v1/mailbox/mailThreads/122?api_token= --- src/Resources/Mailbox.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Resources/Mailbox.php b/src/Resources/Mailbox.php index 1d9f66a..8cdaaa3 100644 --- a/src/Resources/Mailbox.php +++ b/src/Resources/Mailbox.php @@ -31,4 +31,15 @@ public function mailThreads($folder, $options = []) return $this->request->get('mailThreads', $options); } + + /** + * Get mail messages inside specified mail thread by ID. + * + * @param $id Mail threads ID to find messages. + * @return Response + */ + public function mailMessages($id) + { + return $this->request->get('mailThreads/:id/mailMessages', compact('id')); + } } \ No newline at end of file