Skip to content

Place filter (x) value (y) in filters[x]=y qs parameter #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
]
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"authors": [
{
"name": "Roemer Bakker",
"email": "contact@roemerbaker.com"
"email": "contact@roemerbakker.com"
}
],
"keywords": [
Expand Down
10 changes: 5 additions & 5 deletions src/Spryng/SpryngRestApi/Resources/MessageClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class MessageClient extends BaseClient
{
/**
* An array of the existing filters for the list endpoint
*
*
* @var string[]
*/
private static $listFilters = [
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down