Kanan Farzali
Kanan Farzali

Reputation: 1053

DFA Reporting API: how to get a list of reports files

According to the official documentation DCM/DFA Reporting and Trafficking API this the way to get a list of reports files in json format:

   $url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/" . $this->profile_id . "/reports/" . $this->report_id . "/files?key=" . $this->developer_key;

   $opts = array(
        'http' => array(
            'method' => "GET",
            'header' => "content-encoding:  gzip,
                        content-length:  863,
                        content-type:  application/json; charset=UTF-8"
        )
    );

    $context = stream_context_create($opts);

    $response = file_get_contents($url, false, $context);

    var_dump($response);

However, $response returns me false. I have played with it in API explorer, and it works fine there. Any thoughts?

Upvotes: 1

Views: 231

Answers (0)

Related Questions