I'm trying to use the API of battlefieldtracker.com. There is a docu under: http://docs.trnbattlefield.apiary.io
At first I generated an API-key. My second step was to use the documentation to generate the request:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://battlefieldtracker.com/bf1/api/Stats/DetailedStats?platform=3&displayName=PENTA-piidde&game=tunguska");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"TRN-Api-Key: xxxxxx-yyyyyy-aaaaaa-bbbbb-ccccc"
));
$response = curl_exec($ch);
curl_close($ch);
var_dump($response);
The result in PHP is:
bool(false)
In the online try-area of the documentation is my result in any case:
501
Headers
server:Cowboy
connection:keep-alive
x-newrelic-app-data:PxQDVFVRCQITVlZRDgcFV0YdFGQHBDcQUQxLA1tMXV1dSnwZQRNWERdcRE4hJmwcH05DThoBGVZUABoDTFZVWgBQAVsIChgCH0cIVAdUClQAUlMCVVZbBgBGTQRWXUQDOQ==
access-control-allow-origin:*
access-control-allow-methods:OPTIONS,GET,HEAD,POST,PUT,DELETE,TRACE,CONNECT
access-control-max-age:10
x-apiary-transaction-id:5908b3c55e9e851900cf77f1
content-length:0
date:Tue, 02 May 2017 16:28:53 GMT
via:1.1 vegur
Does anyone have an idea to share?