Estimote API integration

Viewed 505

so i've been trying to integrate Estimote API to bring the beacons list to my personal CMS, i'm encountering with the problem that i get "Unauthorised" message i have read through the Api docs and the General - Authorization is the one that i can since i'm bringing the beacons that are in my cloud account, theres an example on a curl request that i can get the list of beacons by doing this:

curl -u app_0a1b2c3d4e:0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d \
     -H 'Accept: application/json' \
     https://cloud.estimote.com/v1/beacons

The problem is that i have been trying to do that and it says that In general i should use App ID and App Token to authorise my requests

header('Content-Type: application/json');

$app_id = "appid";
$token = "token";
$ch = curl_init('https://cloud.estimote.com/v1/beacons?appid='.$appId.'&apptoken='.$token);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));

$result = curl_exec($ch);

print_r($result);
curl_close($ch);

any ideas on what am i doing wrong? https://cloud.estimote.com/docs/#api-Beacons-GetBeacons

1 Answers
Related