Well I have no PHP server atm to test but this is the code snippet generated by Postman. I used the organizations get call to start with something simple. Once you get that working, go further. Perhaps compare your code to this to see if there's anything you're missing: <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.meraki.com/api/v0/organizations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => array(
"Postman-Token: abcdef01-234567890-123456-78901234", // random token generated by postman as workaround to some bug in chrome
"X-Cisco-Meraki-API-Key: abcdef012345678901234567890123456789012", // replace with your API key
"cache-control: no-cache"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
... View more