mirror of
https://github.com/retailcrm/mailgun-php.git
synced 2025-02-06 08:19:25 +03:00
Fixed HTTPBroker Response and README for Stats endpoint
This commit is contained in:
parent
a3e2324d2a
commit
ee2a9aece8
@ -52,8 +52,10 @@ class HttpBroker{
|
||||
|
||||
public function getRequest($endpointUrl, $queryString = array()){
|
||||
$request = $this->mgClient->get($endpointUrl);
|
||||
foreach($queryString as $key=>$value){
|
||||
$request->getQuery()->set($key, $value);
|
||||
if(isset($queryString)){
|
||||
foreach($queryString as $key=>$value){
|
||||
$request->getQuery()->set($key, $value);
|
||||
}
|
||||
}
|
||||
$response = $request->send();
|
||||
return $this->responseHandler($response);
|
||||
@ -75,6 +77,8 @@ class HttpBroker{
|
||||
$httpResponeCode = $responseObj->getStatusCode();
|
||||
if($httpResponeCode === 200){
|
||||
$jsonResponseData = $responseObj->json();
|
||||
$result = new \stdClass();
|
||||
$result->http_response_body = new \stdClass();
|
||||
foreach ($jsonResponseData as $key => $value){
|
||||
$result->http_response_body->$key = $value;
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ $mgClient = new MailgunClient("key-3ax6xnjp29jd6fds4gc373sgvjxteol0", "samples.m
|
||||
$stats = $mgClient->Stats();
|
||||
|
||||
# Next, get the last 50 stats.
|
||||
$stats->getStats(50, 0);
|
||||
$stats->getStats(array('limit' => 50, 'skip' => 0, 'event' => 'sent'));
|
||||
```
|
||||
|
||||
Available Functions
|
||||
@ -25,7 +25,7 @@ Available Functions
|
||||
|
||||
`deleteTag(string $tag)`
|
||||
|
||||
`getStats(int $limit, int $skip)`
|
||||
`getStats(array $filterParams)`
|
||||
|
||||
More Documentation
|
||||
------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user