From b6c813cb9485b4a083523a2c6159f1dba56bdcfc Mon Sep 17 00:00:00 2001 From: John Beitler Date: Fri, 7 Apr 2023 15:14:16 +0200 Subject: [PATCH 1/2] Place filter (x) value (y) in `filters[x]=y` qs parameter --- src/Spryng/SpryngRestApi/Resources/MessageClient.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Spryng/SpryngRestApi/Resources/MessageClient.php b/src/Spryng/SpryngRestApi/Resources/MessageClient.php index cfe6fef..4b04778 100644 --- a/src/Spryng/SpryngRestApi/Resources/MessageClient.php +++ b/src/Spryng/SpryngRestApi/Resources/MessageClient.php @@ -15,7 +15,7 @@ class MessageClient extends BaseClient { /** * An array of the existing filters for the list endpoint - * + * * @var string[] */ private static $listFilters = [ @@ -75,17 +75,17 @@ public function list($filters = []) throw new ValidationException(sprintf('%s is not a valid filter', $filter)); } - $req->addQueryStringParameter($filter, $value); + $req->addQueryStringParameter(sprintf('filters[%s]', $filter), $value); } return $req->send(); } - + /** * Cancel a message scheduled in the future. * * @param string|Message $id The ID of the message to be canceled - * + * * @return Response */ public function cancel($id) @@ -115,7 +115,7 @@ public function send(Message $message) * Show the message with $id * * @param $id The ID of the message to retrieve - * + * * @return Spryng\SpryngRestApi\Http\Response */ public function show($id) From c7bb8aff8cc5ab8ffefb0eb2e9933f188833923c Mon Sep 17 00:00:00 2001 From: John Beitler Date: Fri, 7 Apr 2023 15:15:07 +0200 Subject: [PATCH 2/2] Update README.md; `showAll` is marked as deprecated --- README.md | 4 +--- composer.json | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5177a04..d37b6a6 100644 --- a/README.md +++ b/README.md @@ -81,9 +81,7 @@ use Spryng\SpryngRestApi\Spryng; $spryng = new Spryng($apiKey); -$response = $spryng->message->showAll( - 1, // page - 20, // limit: items per page +$response = $spryng->message->list( [ // An array of filters 'recipient_number' => '31612345667' ] diff --git a/composer.json b/composer.json index 29a80aa..f749c26 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "authors": [ { "name": "Roemer Bakker", - "email": "contact@roemerbaker.com" + "email": "contact@roemerbakker.com" } ], "keywords": [