Probably a stupid question :-D.
I want to get all the clients on the network. My script is working but I get the sentence "You are being redirected" instead of an array with the data. If I click on the link behind "Redirected" I get all the data. But I need this info for my script. Any help would be great.
My code:
<?php
$request = new HttpRequest();
$request->setUrl('https://api.meraki.com/api/v0/devices/SERIALNUMBER/clients');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData(array(
'timespan' => '84000'
));
$request->setHeaders(array(
'postman-token' => '7187e3f4-f792-c5f6-da1e-73e51253767d',
'cache-control' => 'no-cache',
'x-cisco-meraki-api-key' => 'api key'
));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}