Skip to content

Commit f004c0f

Browse files
authored
Merge pull request #261 from pipedrive/GRAL-5509
GRAL-5509 Fix API v2 host path configuration
2 parents 2c3e560 + dbe1f61 commit f004c0f

11 files changed

Lines changed: 926 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [14.4.0](https://github.com/pipedrive/client-php/compare/14.3.3...14.4.0) (2025-11-25)
10+
11+
### Fixed
12+
- API v2 configuration for the host base path: `/api/v2` instead of `/v2`. With this, API v1 configuration also changed from `/v1` to `/api/v1`, but this does not break backward compatibility as both `/api/v1` and `/v1` paths are supported for API v1.
13+
14+
### Added
15+
16+
- Added `POST /products/{id}/duplicate` endpoint for duplicating an existing product
17+
- Added `deal_id` query parameter to the GET `/v2/persons` endpoint
18+
- Added `GET /v1/leadFields` endpoint for fetching all lead fields
19+
920
## [14.3.3](https://github.com/pipedrive/client-php/compare/14.3.2...14.3.3) (2025-11-18)
1021

1122
### Fixed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Pipedrive\versions\v1\LeadFieldsApi
2+
3+
All URIs are relative to https://api.pipedrive.com/v1.
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**getLeadFields()**](LeadFieldsApi.md#getLeadFields) | **GET** /leadFields | Get all lead fields
8+
9+
10+
## `getLeadFields()`
11+
12+
```php
13+
getLeadFields($start, $limit): \Pipedrive\versions\v1\Model\FieldsResponse
14+
```
15+
16+
Get all lead fields
17+
18+
Returns data about all lead fields.
19+
20+
### Example
21+
22+
```php
23+
<?php
24+
require_once(__DIR__ . '/vendor/autoload.php');
25+
26+
27+
// Configure API key authorization: api_key
28+
$config = (new Pipedrive\versions\v1\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
29+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
30+
// $config = (new Pipedrive\versions\v1\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
31+
32+
// Configure OAuth2 access token for authorization: oauth2
33+
$config = (new Pipedrive\versions\v1\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
34+
35+
36+
$apiInstance = new Pipedrive\versions\v1\Api\LeadFieldsApi(
37+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
38+
// This is optional, `GuzzleHttp\Client` will be used as default.
39+
new GuzzleHttp\Client(),
40+
$config
41+
);
42+
$start = 0; // int | Pagination start
43+
$limit = 56; // int | Items shown per page
44+
45+
try {
46+
$result = $apiInstance->getLeadFields($start, $limit);
47+
print_r($result);
48+
} catch (Exception $e) {
49+
echo 'Exception when calling LeadFieldsApi->getLeadFields: ', $e->getMessage(), PHP_EOL;
50+
}
51+
```
52+
53+
### Parameters
54+
55+
Name | Type | Description | Notes
56+
------------- | ------------- | ------------- | -------------
57+
**start** | **int**| Pagination start | [optional] [default to 0]
58+
**limit** | **int**| Items shown per page | [optional]
59+
60+
### Return type
61+
62+
[**\Pipedrive\versions\v1\Model\FieldsResponse**](../Model/FieldsResponse.md)
63+
64+
### Authorization
65+
66+
[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)
67+
68+
### HTTP request headers
69+
70+
- **Content-Type**: Not defined
71+
- **Accept**: `application/json`
72+
73+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
74+
[[Back to Model list]](../README.md#documentation-for-models)
75+
[[Back to README]](../README.md)

docs/versions/v1/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ Class | Method | HTTP request | Description
350350
*GoalsApi* | [**updateGoal**](Api/GoalsApi.md#updategoal) | **PUT** /goals/{id} | Update existing goal
351351
*ItemSearchApi* | [**searchItem**](Api/ItemSearchApi.md#searchitem) | **GET** /itemSearch | Perform a search from multiple item types
352352
*ItemSearchApi* | [**searchItemByField**](Api/ItemSearchApi.md#searchitembyfield) | **GET** /itemSearch/field | Perform a search using a specific field from an item type
353+
*LeadFieldsApi* | [**getLeadFields**](Api/LeadFieldsApi.md#getleadfields) | **GET** /leadFields | Get all lead fields
353354
*LeadLabelsApi* | [**addLeadLabel**](Api/LeadLabelsApi.md#addleadlabel) | **POST** /leadLabels | Add a lead label
354355
*LeadLabelsApi* | [**deleteLeadLabel**](Api/LeadLabelsApi.md#deleteleadlabel) | **DELETE** /leadLabels/{id} | Delete a lead label
355356
*LeadLabelsApi* | [**getLeadLabels**](Api/LeadLabelsApi.md#getleadlabels) | **GET** /leadLabels | Get all lead labels

docs/versions/v2/Api/PersonsApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ Name | Type | Description | Notes
490490
## `getPersons()`
491491

492492
```php
493-
getPersons($filter_id, $ids, $owner_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor): \Pipedrive\versions\v2\Model\GetPersons
493+
getPersons($filter_id, $ids, $owner_id, $org_id, $deal_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor): \Pipedrive\versions\v2\Model\GetPersons
494494
```
495495

496496
Get all persons
@@ -523,6 +523,7 @@ $filter_id = 56; // int | If supplied, only persons matching the specified filte
523523
$ids = 'ids_example'; // string | Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
524524
$owner_id = 56; // int | If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
525525
$org_id = 56; // int | If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
526+
$deal_id = 56; // int | If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored.
526527
$updated_since = 'updated_since_example'; // string | If set, only persons with an `update_time` later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
527528
$updated_until = 'updated_until_example'; // string | If set, only persons with an `update_time` earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
528529
$sort_by = 'id'; // string | The field to sort by. Supported fields: `id`, `update_time`, `add_time`.
@@ -533,7 +534,7 @@ $limit = 100; // int | For pagination, the limit of entries to be returned. If n
533534
$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page
534535

535536
try {
536-
$result = $apiInstance->getPersons($filter_id, $ids, $owner_id, $org_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor);
537+
$result = $apiInstance->getPersons($filter_id, $ids, $owner_id, $org_id, $deal_id, $updated_since, $updated_until, $sort_by, $sort_direction, $include_fields, $custom_fields, $limit, $cursor);
537538
print_r($result);
538539
} catch (Exception $e) {
539540
echo 'Exception when calling PersonsApi->getPersons: ', $e->getMessage(), PHP_EOL;
@@ -548,6 +549,7 @@ Name | Type | Description | Notes
548549
**ids** | **string**| Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response. | [optional]
549550
**owner_id** | **int**| If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored. | [optional]
550551
**org_id** | **int**| If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored. | [optional]
552+
**deal_id** | **int**| If supplied, only persons linked to the specified deal are returned. If filter_id is provided, this is ignored. | [optional]
551553
**updated_since** | **string**| If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional]
552554
**updated_until** | **string**| If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z. | [optional]
553555
**sort_by** | **string**| The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;. | [optional] [default to &#39;id&#39;]

docs/versions/v2/Api/ProductsApi.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Method | HTTP request | Description
1111
[**deleteProductFollower()**](ProductsApi.md#deleteProductFollower) | **DELETE** /products/{id}/followers/{follower_id} | Delete a follower from a product
1212
[**deleteProductImage()**](ProductsApi.md#deleteProductImage) | **DELETE** /products/{id}/images | Delete an image of a product
1313
[**deleteProductVariation()**](ProductsApi.md#deleteProductVariation) | **DELETE** /products/{id}/variations/{product_variation_id} | Delete a product variation
14+
[**duplicateProduct()**](ProductsApi.md#duplicateProduct) | **POST** /products/{id}/duplicate | Duplicate a product
1415
[**getProduct()**](ProductsApi.md#getProduct) | **GET** /products/{id} | Get one product
1516
[**getProductFollowers()**](ProductsApi.md#getProductFollowers) | **GET** /products/{id}/followers | List followers of a product
1617
[**getProductFollowersChangelog()**](ProductsApi.md#getProductFollowersChangelog) | **GET** /products/{id}/followers/changelog | List followers changelog of a product
@@ -487,6 +488,71 @@ Name | Type | Description | Notes
487488
[[Back to Model list]](../README.md#documentation-for-models)
488489
[[Back to README]](../README.md)
489490

491+
## `duplicateProduct()`
492+
493+
```php
494+
duplicateProduct($id): \Pipedrive\versions\v2\Model\ProductResponse
495+
```
496+
497+
Duplicate a product
498+
499+
Creates a duplicate of an existing product including all variations, prices, and custom fields.
500+
501+
### Example
502+
503+
```php
504+
<?php
505+
require_once(__DIR__ . '/vendor/autoload.php');
506+
507+
508+
// Configure API key authorization: api_key
509+
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
510+
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
511+
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
512+
513+
// Configure OAuth2 access token for authorization: oauth2
514+
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
515+
516+
517+
$apiInstance = new Pipedrive\versions\v2\Api\ProductsApi(
518+
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
519+
// This is optional, `GuzzleHttp\Client` will be used as default.
520+
new GuzzleHttp\Client(),
521+
$config
522+
);
523+
$id = 56; // int | The ID of the product
524+
525+
try {
526+
$result = $apiInstance->duplicateProduct($id);
527+
print_r($result);
528+
} catch (Exception $e) {
529+
echo 'Exception when calling ProductsApi->duplicateProduct: ', $e->getMessage(), PHP_EOL;
530+
}
531+
```
532+
533+
### Parameters
534+
535+
Name | Type | Description | Notes
536+
------------- | ------------- | ------------- | -------------
537+
**id** | **int**| The ID of the product |
538+
539+
### Return type
540+
541+
[**\Pipedrive\versions\v2\Model\ProductResponse**](../Model/ProductResponse.md)
542+
543+
### Authorization
544+
545+
[api_key](../README.md#api_key), [oauth2](../README.md#oauth2)
546+
547+
### HTTP request headers
548+
549+
- **Content-Type**: Not defined
550+
- **Accept**: `application/json`
551+
552+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
553+
[[Back to Model list]](../README.md#documentation-for-models)
554+
[[Back to README]](../README.md)
555+
490556
## `getProduct()`
491557

492558
```php

docs/versions/v2/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ Class | Method | HTTP request | Description
347347
*ProductsApi* | [**deleteProductFollower**](Api/ProductsApi.md#deleteproductfollower) | **DELETE** /products/{id}/followers/{follower_id} | Delete a follower from a product
348348
*ProductsApi* | [**deleteProductImage**](Api/ProductsApi.md#deleteproductimage) | **DELETE** /products/{id}/images | Delete an image of a product
349349
*ProductsApi* | [**deleteProductVariation**](Api/ProductsApi.md#deleteproductvariation) | **DELETE** /products/{id}/variations/{product_variation_id} | Delete a product variation
350+
*ProductsApi* | [**duplicateProduct**](Api/ProductsApi.md#duplicateproduct) | **POST** /products/{id}/duplicate | Duplicate a product
350351
*ProductsApi* | [**getProduct**](Api/ProductsApi.md#getproduct) | **GET** /products/{id} | Get one product
351352
*ProductsApi* | [**getProductFollowers**](Api/ProductsApi.md#getproductfollowers) | **GET** /products/{id}/followers | List followers of a product
352353
*ProductsApi* | [**getProductFollowersChangelog**](Api/ProductsApi.md#getproductfollowerschangelog) | **GET** /products/{id}/followers/changelog | List followers changelog of a product

0 commit comments

Comments
 (0)