Skip to content

Commit c4ef1b1

Browse files
Merge pull request #272 from pipedrive/307
Build 307 - version-minor
2 parents fb0a459 + 5ac41b1 commit c4ef1b1

5 files changed

Lines changed: 60 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1515
- `DELETE /v1/stages`
1616
Please use the single delete endpoints instead, for example `DELETE /api/v2/activities/{id}`.
1717

18+
### Added
19+
- Added `updated_since` query parameter to `GET /v1/leads` endpoint to filter leads by their `update_time`
20+
- Added `updated_since` query parameter to `GET /v1/notes` endpoint to filter notes by their `update_time`
21+
22+
## [15.1.0](https://github.com/pipedrive/client-php/compare/15.0.0...15.1.0) (2026-01-27)
23+
1824
## [15.0.0](https://github.com/pipedrive/client-php/compare/14.9.0...15.0.0) (2026-01-27)
1925

2026
## [14.9.0](https://github.com/pipedrive/client-php/compare/14.8.0...14.9.0) (2026-01-27)

docs/versions/v1/Api/LeadsApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ Name | Type | Description | Notes
354354
## `getLeads()`
355355

356356
```php
357-
getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse
357+
getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort): \Pipedrive\versions\v1\Model\GetLeadsResponse
358358
```
359359

360360
Get all leads
@@ -389,10 +389,11 @@ $owner_id = 1; // int | If supplied, only leads matching the given user will be
389389
$person_id = 1; // int | If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied.
390390
$organization_id = 1; // int | If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied.
391391
$filter_id = 1; // int | The ID of the filter to use
392+
$updated_since = 2025-01-01T10:20:00Z; // string | If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z.
392393
$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys).
393394

394395
try {
395-
$result = $apiInstance->getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
396+
$result = $apiInstance->getLeads($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
396397
print_r($result);
397398
} catch (Exception $e) {
398399
echo 'Exception when calling LeadsApi->getLeads: ', $e->getMessage(), PHP_EOL;
@@ -409,6 +410,7 @@ Name | Type | Description | Notes
409410
**person_id** | **int**| If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. | [optional]
410411
**organization_id** | **int**| If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. | [optional]
411412
**filter_id** | **int**| The ID of the filter to use | [optional]
413+
**updated_since** | **string**| If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. | [optional]
412414
**sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). | [optional]
413415

414416
### Return type

docs/versions/v1/Api/NotesApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ Name | Type | Description | Notes
484484
## `getNotes()`
485485

486486
```php
487-
getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag): \Pipedrive\versions\v1\Model\GetNotes
487+
getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $updated_since, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag): \Pipedrive\versions\v1\Model\GetNotes
488488
```
489489

490490
Get all notes
@@ -524,14 +524,15 @@ $limit = 56; // int | Items shown per page
524524
$sort = 'sort_example'; // string | The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`.
525525
$start_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date in format of YYYY-MM-DD from which notes to fetch
526526
$end_date = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | The date in format of YYYY-MM-DD until which notes to fetch to
527+
$updated_since = 2025-01-01T10:20Z; // \DateTime | If set, only notes with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
527528
$pinned_to_lead_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to lead pinning state
528529
$pinned_to_deal_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to deal pinning state
529530
$pinned_to_organization_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to organization pinning state
530531
$pinned_to_person_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to person pinning state
531532
$pinned_to_project_flag = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBoolean(); // \Pipedrive\versions\v1\Model\NumberBoolean | If set, the results are filtered by note to project pinning state
532533

533534
try {
534-
$result = $apiInstance->getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag);
535+
$result = $apiInstance->getNotes($user_id, $lead_id, $deal_id, $person_id, $org_id, $project_id, $start, $limit, $sort, $start_date, $end_date, $updated_since, $pinned_to_lead_flag, $pinned_to_deal_flag, $pinned_to_organization_flag, $pinned_to_person_flag, $pinned_to_project_flag);
535536
print_r($result);
536537
} catch (Exception $e) {
537538
echo 'Exception when calling NotesApi->getNotes: ', $e->getMessage(), PHP_EOL;
@@ -553,6 +554,7 @@ Name | Type | Description | Notes
553554
**sort** | **string**| The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). Supported fields: `id`, `user_id`, `deal_id`, `person_id`, `org_id`, `content`, `add_time`, `update_time`. | [optional]
554555
**start_date** | **\DateTime**| The date in format of YYYY-MM-DD from which notes to fetch | [optional]
555556
**end_date** | **\DateTime**| The date in format of YYYY-MM-DD until which notes to fetch to | [optional]
557+
**updated_since** | **\DateTime**| If set, only notes with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional]
556558
**pinned_to_lead_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to lead pinning state | [optional]
557559
**pinned_to_deal_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to deal pinning state | [optional]
558560
**pinned_to_organization_flag** | [**\Pipedrive\versions\v1\Model\NumberBoolean**](../Model/.md)| If set, the results are filtered by note to organization pinning state | [optional]

lib/versions/v1/Api/LeadsApi.php

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,15 +1717,16 @@ public function getLeadUsersRequest($id): Request
17171717
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional)
17181718
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional)
17191719
* @param int|null $filter_id The ID of the filter to use (optional)
1720+
* @param string|null $updated_since If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. (optional)
17201721
* @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional)
17211722
*
17221723
* @throws ApiException on non-2xx response
17231724
* @throws InvalidArgumentException|GuzzleException
17241725
* @return \Pipedrive\versions\v1\Model\GetLeadsResponse
17251726
*/
1726-
public function getLeads($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null)
1727+
public function getLeads($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null)
17271728
{
1728-
list($response) = $this->getLeadsWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
1729+
list($response) = $this->getLeadsWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
17291730
return $response;
17301731
}
17311732

@@ -1740,15 +1741,16 @@ public function getLeads($limit = null, $start = null, $owner_id = null, $person
17401741
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, `filter_id` takes precedence over `person_id` when supplied. (optional)
17411742
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, `filter_id` takes precedence over `organization_id` when supplied. (optional)
17421743
* @param int|null $filter_id The ID of the filter to use (optional)
1744+
* @param string|null $updated_since If set, only leads with an `update_time` later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. (optional)
17431745
* @param string|null $sort The field names and sorting mode separated by a comma (`field_name_1 ASC`, `field_name_2 DESC`). Only first-level field keys are supported (no nested keys). (optional)
17441746
*
17451747
* @throws ApiException on non-2xx response
17461748
* @throws InvalidArgumentException|GuzzleException
17471749
* @return array<mixed> of \Pipedrive\versions\v1\Model\GetLeadsResponse, HTTP status code, HTTP response headers (array of strings)
17481750
*/
1749-
public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null)
1751+
public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null)
17501752
{
1751-
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
1753+
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
17521754

17531755
try {
17541756
$options = $this->createHttpClientOption();
@@ -1757,7 +1759,7 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = n
17571759
} catch (RequestException $e) {
17581760
if ($e->getCode() === 401 && $this->config->isRefreshPossible()) {
17591761
$this->config->refreshToken();
1760-
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
1762+
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
17611763
$response = $this->client->send($request, $options);
17621764
} else {
17631765
throw new ApiException(
@@ -1847,14 +1849,15 @@ public function getLeadsWithHttpInfo($limit = null, $start = null, $owner_id = n
18471849
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;person_id&#x60; when supplied. (optional)
18481850
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;organization_id&#x60; when supplied. (optional)
18491851
* @param int|null $filter_id The ID of the filter to use (optional)
1852+
* @param string|null $updated_since If set, only leads with an &#x60;update_time&#x60; later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. (optional)
18501853
* @param string|null $sort The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys). (optional)
18511854
*
18521855
* @throws InvalidArgumentException|OAuthProviderException
18531856
* @return PromiseInterface
18541857
*/
1855-
public function getLeadsAsync($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface
1858+
public function getLeadsAsync($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null): PromiseInterface
18561859
{
1857-
return $this->getLeadsAsyncWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort)
1860+
return $this->getLeadsAsyncWithHttpInfo($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort)
18581861
->then(
18591862
function ($response) {
18601863
return $response[0];
@@ -1873,15 +1876,16 @@ function ($response) {
18731876
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;person_id&#x60; when supplied. (optional)
18741877
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;organization_id&#x60; when supplied. (optional)
18751878
* @param int|null $filter_id The ID of the filter to use (optional)
1879+
* @param string|null $updated_since If set, only leads with an &#x60;update_time&#x60; later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. (optional)
18761880
* @param string|null $sort The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys). (optional)
18771881
*
18781882
* @throws InvalidArgumentException|OAuthProviderException
18791883
* @return PromiseInterface
18801884
*/
1881-
public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): PromiseInterface
1885+
public function getLeadsAsyncWithHttpInfo($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null): PromiseInterface
18821886
{
18831887
$returnType = '\Pipedrive\versions\v1\Model\GetLeadsResponse';
1884-
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $sort);
1888+
$request = $this->getLeadsRequest($limit, $start, $owner_id, $person_id, $organization_id, $filter_id, $updated_since, $sort);
18851889

18861890
return $this->client
18871891
->sendAsync($request, $this->createHttpClientOption())
@@ -1926,12 +1930,13 @@ function ($exception) {
19261930
* @param int|null $person_id If supplied, only leads matching the given person will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;person_id&#x60; when supplied. (optional)
19271931
* @param int|null $organization_id If supplied, only leads matching the given organization will be returned. However, &#x60;filter_id&#x60; takes precedence over &#x60;organization_id&#x60; when supplied. (optional)
19281932
* @param int|null $filter_id The ID of the filter to use (optional)
1933+
* @param string|null $updated_since If set, only leads with an &#x60;update_time&#x60; later than or equal to this time are returned. In ISO 8601 format, e.g. 2025-01-01T10:20:00Z. (optional)
19291934
* @param string|null $sort The field names and sorting mode separated by a comma (&#x60;field_name_1 ASC&#x60;, &#x60;field_name_2 DESC&#x60;). Only first-level field keys are supported (no nested keys). (optional)
19301935
*
19311936
* @throws InvalidArgumentException|OAuthProviderException
19321937
* @return Request
19331938
*/
1934-
public function getLeadsRequest($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $sort = null): Request
1939+
public function getLeadsRequest($limit = null, $start = null, $owner_id = null, $person_id = null, $organization_id = null, $filter_id = null, $updated_since = null, $sort = null): Request
19351940
{
19361941

19371942
$resourcePath = '/leads';
@@ -1991,6 +1996,14 @@ public function getLeadsRequest($limit = null, $start = null, $owner_id = null,
19911996
}
19921997
// query params
19931998
/* @phpstan-ignore-next-line */
1999+
if (is_array($updated_since)) {
2000+
$updated_since = ObjectSerializer::serializeCollection($updated_since, '', true);
2001+
}
2002+
if ($updated_since !== null) {
2003+
$queryParams['updated_since'] = $updated_since;
2004+
}
2005+
// query params
2006+
/* @phpstan-ignore-next-line */
19942007
if (is_array($sort)) {
19952008
$sort = ObjectSerializer::serializeCollection($sort, '', true);
19962009
}

0 commit comments

Comments
 (0)