Skip to content

Commit

Permalink
fixes in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jper92 committed Mar 12, 2015
1 parent 653b13d commit 9d986b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,25 @@ Ejemplos de llamadas al API:
->getContacts('12345678' /* Or a name, it works too */,
/*limit*/ 10,/* offset */ 0, /* contact status */'SUSCRIBED');

if ($contacts->ok) /* do something */ ;
if ($response->ok){
/* Do something */
echo "Mis contactos son: \n";
foreach ($response->data as $contact){
echo "$contact->msisdn : $contact->first_name\n";
}
}


$groups = $api->groups()
->getGroups("my group" /*$query*/, 0 /*$limit*/,0 /* $offset */,
false /*$shortResults*/);

if ($groups->ok) /* do something */ ;
if ($groups->ok){
echo "Mis grupos\n";
foreach ($groups->data as $group){
echo " Grupo: $group->name, miembros: {$group->members->total}\n";
}
}


$message = $api->messages()
Expand Down
4 changes: 2 additions & 2 deletions src/libs/ApiWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ public function send($url, $params, $method, $body){
$has_status = preg_match('/\ ([^\ ]+)$/', $http_response_header[0], $status);
if ($has_status) $status = $status[1];
$data = array(
'code' => $response_code,
'status' => $status+0,
'code' => $response_code+0,
'status' => $status,
'ok' => $status=="OK",
'response_headers' => $http_response_header,
'data' => $json,
Expand Down

0 comments on commit 9d986b5

Please # to comment.