Skip to content

Commit 20447a4

Browse files
ib-fsrnecinfobip-ci
and
infobip-ci
authored
Release 6.2.1 (#74)
* Update to version 6.2.1 * Adjust CHANGELOG --------- Co-authored-by: infobip-ci <support@infobip.com>
1 parent 90f5142 commit 20447a4

35 files changed

+479
-7908
lines changed

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ All notable changes to the library will be documented in this file.
44

55
The format of the file is based on [Keep a Changelog](http://keepachangelog.com/) and this library adheres to [Semantic Versioning](http://semver.org/) as mentioned in the [README.md][readme] file.
66

7+
## [ [6.2.1](https://github.com/infobip/infobip-api-php-client/releases/tag/6.2.0) ] - 2025-01-24
8+
9+
### Added
10+
* An option to define the `messageId` for all channels in Messages API failover flow.
11+
* New voices and languages for Calls API.
12+
13+
### Fixed
14+
15+
* Serialization of `CallsDtmfOptions`, `CallsCollectOptions` and `CallsCallApiOptions` in IVR scenario scripts.
16+
* [Issue #67](https://github.com/infobip/infobip-api-php-client/issues/67): Fetching WhatsApp media metadata methods now return an array that contains header values provided by the API.
17+
This version provides an additional fix that fully resolves the issue.
18+
19+
### Changed
20+
* Field `from` is no longer required when creating outbound calls.
21+
* Form parameter processing code is refactored and removed from the API methods where it is not needed.
22+
23+
### Removed
24+
* A no longer required `DISCONNECTED` call state.
25+
726
## [ [6.2.0](https://github.com/infobip/infobip-api-php-client/releases/tag/6.2.0) ] - 2025-01-20
827

928
⚠️ **IMPORTANT NOTE:** This release contains breaking changes!

Infobip/Api/CallLinkApi.php

Lines changed: 0 additions & 447 deletions
Large diffs are not rendered by default.

Infobip/Api/CallRoutingApi.php

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
* @author Infobip Support
1212
* @link https://www.infobip.com
1313
*/
14-
1514
declare(strict_types=1);
1615

1716
/**
@@ -33,7 +32,6 @@
3332
use GuzzleHttp\Exception\GuzzleException;
3433
use GuzzleHttp\Exception\RequestException;
3534
use GuzzleHttp\Promise\PromiseInterface;
36-
use GuzzleHttp\Psr7\MultipartStream;
3735
use GuzzleHttp\Psr7\Query;
3836
use GuzzleHttp\Psr7\Request;
3937
use Infobip\ApiException;
@@ -174,7 +172,6 @@ private function createCallRouteRequest(\Infobip\Model\CallRoutingRouteRequest $
174172

175173
$this->validateParams($allData, $validationConstraints);
176174
$resourcePath = '/callrouting/1/routes';
177-
$formParams = [];
178175
$queryParams = [];
179176
$headerParams = [];
180177
$httpBody = '';
@@ -184,36 +181,10 @@ private function createCallRouteRequest(\Infobip\Model\CallRoutingRouteRequest $
184181
'Content-Type' => 'application/json',
185182
];
186183

187-
// for model (json/xml)
188184
if (isset($callRoutingRouteRequest)) {
189185
$httpBody = ($headers['Content-Type'] === 'application/json')
190186
? $this->objectSerializer->serialize($callRoutingRouteRequest)
191187
: $callRoutingRouteRequest;
192-
} elseif (count($formParams) > 0) {
193-
if ($headers['Content-Type'] === 'multipart/form-data') {
194-
$boundary = '----' . hash('sha256', uniqid('', true));
195-
$headers['Content-Type'] .= '; boundary=' . $boundary;
196-
$multipartContents = [];
197-
198-
foreach ($formParams as $formParamName => $formParamValue) {
199-
$formParamValueItems = (\is_array($formParamValue)) ? $formParamValue : [$formParamValue];
200-
201-
foreach ($formParamValueItems as $formParamValueItem) {
202-
$multipartContents[] = [
203-
'name' => $formParamName,
204-
'contents' => $formParamValueItem
205-
];
206-
}
207-
}
208-
209-
// for HTTP post (form)
210-
$httpBody = new MultipartStream($multipartContents, $boundary);
211-
} elseif ($headers['Content-Type'] === 'application/json') {
212-
$httpBody = $this->objectSerializer->serialize($formParams);
213-
} else {
214-
// for HTTP post (form)
215-
$httpBody = Query::build($formParams);
216-
}
217188
}
218189

219190
$apiKey = $this->config->getApiKey();
@@ -442,7 +413,6 @@ private function deleteCallRouteRequest(string $routeId): Request
442413

443414
$this->validateParams($allData, $validationConstraints);
444415
$resourcePath = '/callrouting/1/routes/{routeId}';
445-
$formParams = [];
446416
$queryParams = [];
447417
$headerParams = [];
448418
$httpBody = '';
@@ -460,33 +430,6 @@ private function deleteCallRouteRequest(string $routeId): Request
460430
'Accept' => 'application/json',
461431
];
462432

463-
// for model (json/xml)
464-
if (count($formParams) > 0) {
465-
if ($headers['Content-Type'] === 'multipart/form-data') {
466-
$boundary = '----' . hash('sha256', uniqid('', true));
467-
$headers['Content-Type'] .= '; boundary=' . $boundary;
468-
$multipartContents = [];
469-
470-
foreach ($formParams as $formParamName => $formParamValue) {
471-
$formParamValueItems = (\is_array($formParamValue)) ? $formParamValue : [$formParamValue];
472-
473-
foreach ($formParamValueItems as $formParamValueItem) {
474-
$multipartContents[] = [
475-
'name' => $formParamName,
476-
'contents' => $formParamValueItem
477-
];
478-
}
479-
}
480-
481-
// for HTTP post (form)
482-
$httpBody = new MultipartStream($multipartContents, $boundary);
483-
} elseif ($headers['Content-Type'] === 'application/json') {
484-
$httpBody = $this->objectSerializer->serialize($formParams);
485-
} else {
486-
// for HTTP post (form)
487-
$httpBody = Query::build($formParams);
488-
}
489-
}
490433

491434
$apiKey = $this->config->getApiKey();
492435

@@ -714,7 +657,6 @@ private function getCallRouteRequest(string $routeId): Request
714657

715658
$this->validateParams($allData, $validationConstraints);
716659
$resourcePath = '/callrouting/1/routes/{routeId}';
717-
$formParams = [];
718660
$queryParams = [];
719661
$headerParams = [];
720662
$httpBody = '';
@@ -732,33 +674,6 @@ private function getCallRouteRequest(string $routeId): Request
732674
'Accept' => 'application/json',
733675
];
734676

735-
// for model (json/xml)
736-
if (count($formParams) > 0) {
737-
if ($headers['Content-Type'] === 'multipart/form-data') {
738-
$boundary = '----' . hash('sha256', uniqid('', true));
739-
$headers['Content-Type'] .= '; boundary=' . $boundary;
740-
$multipartContents = [];
741-
742-
foreach ($formParams as $formParamName => $formParamValue) {
743-
$formParamValueItems = (\is_array($formParamValue)) ? $formParamValue : [$formParamValue];
744-
745-
foreach ($formParamValueItems as $formParamValueItem) {
746-
$multipartContents[] = [
747-
'name' => $formParamName,
748-
'contents' => $formParamValueItem
749-
];
750-
}
751-
}
752-
753-
// for HTTP post (form)
754-
$httpBody = new MultipartStream($multipartContents, $boundary);
755-
} elseif ($headers['Content-Type'] === 'application/json') {
756-
$httpBody = $this->objectSerializer->serialize($formParams);
757-
} else {
758-
// for HTTP post (form)
759-
$httpBody = Query::build($formParams);
760-
}
761-
}
762677

763678
$apiKey = $this->config->getApiKey();
764679

@@ -994,7 +909,6 @@ private function getCallRoutesRequest(int $page = 0, int $size = 20): Request
994909

995910
$this->validateParams($allData, $validationConstraints);
996911
$resourcePath = '/callrouting/1/routes';
997-
$formParams = [];
998912
$queryParams = [];
999913
$headerParams = [];
1000914
$httpBody = '';
@@ -1013,33 +927,6 @@ private function getCallRoutesRequest(int $page = 0, int $size = 20): Request
1013927
'Accept' => 'application/json',
1014928
];
1015929

1016-
// for model (json/xml)
1017-
if (count($formParams) > 0) {
1018-
if ($headers['Content-Type'] === 'multipart/form-data') {
1019-
$boundary = '----' . hash('sha256', uniqid('', true));
1020-
$headers['Content-Type'] .= '; boundary=' . $boundary;
1021-
$multipartContents = [];
1022-
1023-
foreach ($formParams as $formParamName => $formParamValue) {
1024-
$formParamValueItems = (\is_array($formParamValue)) ? $formParamValue : [$formParamValue];
1025-
1026-
foreach ($formParamValueItems as $formParamValueItem) {
1027-
$multipartContents[] = [
1028-
'name' => $formParamName,
1029-
'contents' => $formParamValueItem
1030-
];
1031-
}
1032-
}
1033-
1034-
// for HTTP post (form)
1035-
$httpBody = new MultipartStream($multipartContents, $boundary);
1036-
} elseif ($headers['Content-Type'] === 'application/json') {
1037-
$httpBody = $this->objectSerializer->serialize($formParams);
1038-
} else {
1039-
// for HTTP post (form)
1040-
$httpBody = Query::build($formParams);
1041-
}
1042-
}
1043930

1044931
$apiKey = $this->config->getApiKey();
1045932

@@ -1274,7 +1161,6 @@ private function updateCallRouteRequest(string $routeId, \Infobip\Model\CallRout
12741161

12751162
$this->validateParams($allData, $validationConstraints);
12761163
$resourcePath = '/callrouting/1/routes/{routeId}';
1277-
$formParams = [];
12781164
$queryParams = [];
12791165
$headerParams = [];
12801166
$httpBody = '';
@@ -1293,36 +1179,10 @@ private function updateCallRouteRequest(string $routeId, \Infobip\Model\CallRout
12931179
'Content-Type' => 'application/json',
12941180
];
12951181

1296-
// for model (json/xml)
12971182
if (isset($callRoutingRouteRequest)) {
12981183
$httpBody = ($headers['Content-Type'] === 'application/json')
12991184
? $this->objectSerializer->serialize($callRoutingRouteRequest)
13001185
: $callRoutingRouteRequest;
1301-
} elseif (count($formParams) > 0) {
1302-
if ($headers['Content-Type'] === 'multipart/form-data') {
1303-
$boundary = '----' . hash('sha256', uniqid('', true));
1304-
$headers['Content-Type'] .= '; boundary=' . $boundary;
1305-
$multipartContents = [];
1306-
1307-
foreach ($formParams as $formParamName => $formParamValue) {
1308-
$formParamValueItems = (\is_array($formParamValue)) ? $formParamValue : [$formParamValue];
1309-
1310-
foreach ($formParamValueItems as $formParamValueItem) {
1311-
$multipartContents[] = [
1312-
'name' => $formParamName,
1313-
'contents' => $formParamValueItem
1314-
];
1315-
}
1316-
}
1317-
1318-
// for HTTP post (form)
1319-
$httpBody = new MultipartStream($multipartContents, $boundary);
1320-
} elseif ($headers['Content-Type'] === 'application/json') {
1321-
$httpBody = $this->objectSerializer->serialize($formParams);
1322-
} else {
1323-
// for HTTP post (form)
1324-
$httpBody = Query::build($formParams);
1325-
}
13261186
}
13271187

13281188
$apiKey = $this->config->getApiKey();

0 commit comments

Comments
 (0)