Skip to content

Instantly share code, notes, and snippets.

@vseow
Created August 7, 2015 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vseow/046daba8767dab55f880 to your computer and use it in GitHub Desktop.
Save vseow/046daba8767dab55f880 to your computer and use it in GitHub Desktop.
Get Beacon Info with PHP (Kontakt)
<?php
$url = 'https://api.kontakt.io/beacon?proximity=';
$prox = 'f7826da6-4fa2-4e98-8024-bc5b71e0893e'; // Example UUID
$major = '37579';
$minor = '51992';
$privKey = 'insert-your-api-key-here';
$rest = curl_init();
curl_setopt($rest, CURLOPT_URL, $url.$prox."&major=".$major."&minor=".$minor);
curl_setopt($rest,CURLOPT_HTTPHEADER,
array("Api-Key: ".$privKey,
"Accept: application/vnd.com.kontakt+json;version=5",
"Content-Type: application/x-www-form-urlencoded"));
$response = curl_exec($rest);
echo $response;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment