function httpPost( $url, $data )
{
$curl = curl_init( $url );
curl_setopt( $curl, CURLOPT_POST, true );
curl_setopt( $curl, CURLOPT_POSTFIELDS, $data );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
$headers = array(
'X-Algolia-Application-Id: '.AL_APP_ID,
'X-Algolia-API-Key: '.AL_APP_KEY
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
doDebug('curl-headers',$headers);
$response = curl_exec( $curl );
curl_close( $curl );
return $response;
}
I am using the code above to try and access the Places using the following URL https://places-dsn.algolia.net/1/places/query
Which works fine unless I try and authenticate with the Application ID (plSIJRKTUUU7) and Search Key from my account at which point I get
Invalid Application-ID or API key
I suspect I am missing something obvious on the documentation and I am very new to algolia.
Documentation I am using is here https://community.algolia.com/places/rest.html