Skip to content
Open
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Added
- Added `include_body` query parameter to `GET /v1/deals/{id}/mailMessages`, `GET /v1/persons/{id}/mailMessages`, and `GET /v1/organizations/{id}/mailMessages` — pass `1` to include the mail message body content in the response
- Added `body` field to `MailMessageData` schema to expose the mail message body content when `include_body=1` is used

## [17.3.0](https://github.com/pipedrive/client-php/compare17.2.1...17.3.0) (2026-04-06)

Expand Down
6 changes: 4 additions & 2 deletions docs/versions/v1/Api/DealsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ Name | Type | Description | Notes
## `getDealMailMessages()`

```php
getDealMailMessages($id, $start, $limit): \Pipedrive\versions\v1\Model\ListMailMessagesResponse
getDealMailMessages($id, $start, $limit, $include_body): \Pipedrive\versions\v1\Model\ListMailMessagesResponse
```

List mail messages associated with a deal
Expand Down Expand Up @@ -839,9 +839,10 @@ $apiInstance = new Pipedrive\versions\v1\Api\DealsApi(
$id = 56; // int | The ID of the deal
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page
$include_body = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBooleanDefault0(); // \Pipedrive\versions\v1\Model\NumberBooleanDefault0 | Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include.

try {
$result = $apiInstance->getDealMailMessages($id, $start, $limit);
$result = $apiInstance->getDealMailMessages($id, $start, $limit, $include_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DealsApi->getDealMailMessages: ', $e->getMessage(), PHP_EOL;
Expand All @@ -855,6 +856,7 @@ Name | Type | Description | Notes
**id** | **int**| The ID of the deal |
**start** | **int**| Pagination start | [optional] [default to 0]
**limit** | **int**| Items shown per page | [optional]
**include_body** | [**\Pipedrive\versions\v1\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. | [optional]

### Return type

Expand Down
6 changes: 4 additions & 2 deletions docs/versions/v1/Api/OrganizationsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ Name | Type | Description | Notes
## `getOrganizationMailMessages()`

```php
getOrganizationMailMessages($id, $start, $limit): \Pipedrive\versions\v1\Model\ListMailMessagesResponse
getOrganizationMailMessages($id, $start, $limit, $include_body): \Pipedrive\versions\v1\Model\ListMailMessagesResponse
```

List mail messages associated with an organization
Expand Down Expand Up @@ -389,9 +389,10 @@ $apiInstance = new Pipedrive\versions\v1\Api\OrganizationsApi(
$id = 56; // int | The ID of the organization
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page
$include_body = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBooleanDefault0(); // \Pipedrive\versions\v1\Model\NumberBooleanDefault0 | Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include.

try {
$result = $apiInstance->getOrganizationMailMessages($id, $start, $limit);
$result = $apiInstance->getOrganizationMailMessages($id, $start, $limit, $include_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling OrganizationsApi->getOrganizationMailMessages: ', $e->getMessage(), PHP_EOL;
Expand All @@ -405,6 +406,7 @@ Name | Type | Description | Notes
**id** | **int**| The ID of the organization |
**start** | **int**| Pagination start | [optional] [default to 0]
**limit** | **int**| Items shown per page | [optional]
**include_body** | [**\Pipedrive\versions\v1\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. | [optional]

### Return type

Expand Down
6 changes: 4 additions & 2 deletions docs/versions/v1/Api/PersonsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ Name | Type | Description | Notes
## `getPersonMailMessages()`

```php
getPersonMailMessages($id, $start, $limit): \Pipedrive\versions\v1\Model\ListMailMessagesResponse
getPersonMailMessages($id, $start, $limit, $include_body): \Pipedrive\versions\v1\Model\ListMailMessagesResponse
```

List mail messages associated with a person
Expand Down Expand Up @@ -532,9 +532,10 @@ $apiInstance = new Pipedrive\versions\v1\Api\PersonsApi(
$id = 56; // int | The ID of the person
$start = 0; // int | Pagination start
$limit = 56; // int | Items shown per page
$include_body = new \Pipedrive\versions\v1\Model\\Pipedrive\versions\v1\Model\NumberBooleanDefault0(); // \Pipedrive\versions\v1\Model\NumberBooleanDefault0 | Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include.

try {
$result = $apiInstance->getPersonMailMessages($id, $start, $limit);
$result = $apiInstance->getPersonMailMessages($id, $start, $limit, $include_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PersonsApi->getPersonMailMessages: ', $e->getMessage(), PHP_EOL;
Expand All @@ -548,6 +549,7 @@ Name | Type | Description | Notes
**id** | **int**| The ID of the person |
**start** | **int**| Pagination start | [optional] [default to 0]
**limit** | **int**| Items shown per page | [optional]
**include_body** | [**\Pipedrive\versions\v1\Model\NumberBooleanDefault0**](../Model/.md)| Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. | [optional]

### Return type

Expand Down
1 change: 1 addition & 0 deletions docs/versions/v1/Model/MailMessageData.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**cc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message copies (object) | [optional]
**bcc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message blind copies (object) | [optional]
**body_url** | **string** | The mail message body URL | [optional]
**body** | **string** | The mail message body content. Only present when `include_body=1` is passed. | [optional]
**account_id** | **string** | The connection account ID | [optional]
**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional]
**mail_thread_id** | **int** | ID of the mail message thread | [optional]
Expand Down
1 change: 1 addition & 0 deletions docs/versions/v1/Model/MailMessageItemForList.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**cc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message copies (object) | [optional]
**bcc** | [**\Pipedrive\versions\v1\Model\MailParticipant[]**](MailParticipant.md) | The array of mail message blind copies (object) | [optional]
**body_url** | **string** | The mail message body URL | [optional]
**body** | **string** | The mail message body content. Only present when `include_body=1` is passed. | [optional]
**account_id** | **string** | The connection account ID | [optional]
**user_id** | **int** | ID of the user whom mail message will be assigned to | [optional]
**mail_thread_id** | **int** | ID of the mail message thread | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/v2/Model/ActivityFieldItemOptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | The option ID | [optional]
**id** | [**OneOfIntegerString**](OneOfIntegerString.md) | The option ID (integer for custom fields, string for built-in fields) | [optional]
**label** | **string** | The option display label | [optional]
**color** | **string** | Optional color code for the option | [optional]
**update_time** | **\DateTime** | When the option was last updated | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/v2/Model/DealFieldItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**field_name** | **string** | The display name/label of the field |
**field_code** | **string** | The unique identifier for the field (40-character hash for custom fields) |
**description** | **string** | The description of the field |
**description** | **string** | The description of the field | [optional]
**field_type** | **string** | The type of the field |
**options** | [**\Pipedrive\versions\v2\Model\ActivityFieldItemOptions[]**](ActivityFieldItemOptions.md) | Array of available options for enum/set fields, null for other field types | [optional]
**subfields** | [**\Pipedrive\versions\v2\Model\ActivityFieldItemSubfields[]**](ActivityFieldItemSubfields.md) | Array of subfields for complex field types (address, monetary), null for simple field types | [optional]
Expand Down
2 changes: 1 addition & 1 deletion docs/versions/v2/Model/DeleteDealFieldData.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**field_name** | **string** | The display name/label of the field |
**field_code** | **string** | The unique identifier for the field (40-character hash for custom fields) |
**description** | **string** | The description of the field |
**description** | **string** | The description of the field | [optional]
**field_type** | **string** | The type of the field |
**options** | **object[]** | Array of available options for enum/set fields, null for other field types | [optional]
**subfields** | **object[]** | Array of subfields for complex field types (address, monetary), null for simple field types | [optional]
Expand Down
33 changes: 23 additions & 10 deletions lib/versions/v1/Api/DealsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -3838,14 +3838,15 @@ public function getDealFollowersRequest($id): Request
* @param int $id The ID of the deal (required)
* @param int|0 $start Pagination start (optional, default to 0)
* @param int|null $limit Items shown per page (optional)
* @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return \Pipedrive\versions\v1\Model\ListMailMessagesResponse
*/
public function getDealMailMessages($id, $start = 0, $limit = null)
public function getDealMailMessages($id, $start = 0, $limit = null, $include_body = null)
{
list($response) = $this->getDealMailMessagesWithHttpInfo($id, $start, $limit);
list($response) = $this->getDealMailMessagesWithHttpInfo($id, $start, $limit, $include_body);
return $response;
}

Expand All @@ -3857,14 +3858,15 @@ public function getDealMailMessages($id, $start = 0, $limit = null)
* @param int $id The ID of the deal (required)
* @param int|0 $start Pagination start (optional, default to 0)
* @param int|null $limit Items shown per page (optional)
* @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. `0` = Don't include, `1` = Include. (optional)
*
* @throws ApiException on non-2xx response
* @throws InvalidArgumentException|GuzzleException
* @return array<mixed> of \Pipedrive\versions\v1\Model\ListMailMessagesResponse, HTTP status code, HTTP response headers (array of strings)
*/
public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null)
public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null, $include_body = null)
{
$request = $this->getDealMailMessagesRequest($id, $start, $limit);
$request = $this->getDealMailMessagesRequest($id, $start, $limit, $include_body);

try {
$options = $this->createHttpClientOption();
Expand All @@ -3873,7 +3875,7 @@ public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null)
} catch (RequestException $e) {
if ($e->getCode() === 401 && $this->config->isRefreshPossible()) {
$this->config->refreshToken();
$request = $this->getDealMailMessagesRequest($id, $start, $limit);
$request = $this->getDealMailMessagesRequest($id, $start, $limit, $include_body);
$response = $this->client->send($request, $options);
} else {
throw new ApiException(
Expand Down Expand Up @@ -3960,13 +3962,14 @@ public function getDealMailMessagesWithHttpInfo($id, $start = 0, $limit = null)
* @param int $id The ID of the deal (required)
* @param int|0 $start Pagination start (optional, default to 0)
* @param int|null $limit Items shown per page (optional)
* @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. &#x60;0&#x60; &#x3D; Don&#39;t include, &#x60;1&#x60; &#x3D; Include. (optional)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
*/
public function getDealMailMessagesAsync($id, $start = 0, $limit = null): PromiseInterface
public function getDealMailMessagesAsync($id, $start = 0, $limit = null, $include_body = null): PromiseInterface
{
return $this->getDealMailMessagesAsyncWithHttpInfo($id, $start, $limit)
return $this->getDealMailMessagesAsyncWithHttpInfo($id, $start, $limit, $include_body)
->then(
function ($response) {
return $response[0];
Expand All @@ -3982,14 +3985,15 @@ function ($response) {
* @param int $id The ID of the deal (required)
* @param int|0 $start Pagination start (optional, default to 0)
* @param int|null $limit Items shown per page (optional)
* @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. &#x60;0&#x60; &#x3D; Don&#39;t include, &#x60;1&#x60; &#x3D; Include. (optional)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return PromiseInterface
*/
public function getDealMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null): PromiseInterface
public function getDealMailMessagesAsyncWithHttpInfo($id, $start = 0, $limit = null, $include_body = null): PromiseInterface
{
$returnType = '\Pipedrive\versions\v1\Model\ListMailMessagesResponse';
$request = $this->getDealMailMessagesRequest($id, $start, $limit);
$request = $this->getDealMailMessagesRequest($id, $start, $limit, $include_body);

return $this->client
->sendAsync($request, $this->createHttpClientOption())
Expand Down Expand Up @@ -4031,11 +4035,12 @@ function ($exception) {
* @param int $id The ID of the deal (required)
* @param int|0 $start Pagination start (optional, default to 0)
* @param int|null $limit Items shown per page (optional)
* @param \Pipedrive\versions\v1\Model\NumberBooleanDefault0|null $include_body Whether to include the mail message body content in the response. &#x60;0&#x60; &#x3D; Don&#39;t include, &#x60;1&#x60; &#x3D; Include. (optional)
*
* @throws InvalidArgumentException|OAuthProviderException
* @return Request
*/
public function getDealMailMessagesRequest($id, $start = 0, $limit = null): Request
public function getDealMailMessagesRequest($id, $start = 0, $limit = null, $include_body = null): Request
{
// verify the required parameter 'id' is set
/* @phpstan-ignore-next-line */
Expand Down Expand Up @@ -4068,6 +4073,14 @@ public function getDealMailMessagesRequest($id, $start = 0, $limit = null): Requ
if ($limit !== null) {
$queryParams['limit'] = $limit;
}
// query params
/* @phpstan-ignore-next-line */
if (is_array($include_body)) {
$include_body = ObjectSerializer::serializeCollection($include_body, '', true);
}
if ($include_body !== null) {
$queryParams['include_body'] = $include_body;
}


// path params
Expand Down
Loading