Report API Examples
Since the Report API is constructed on top of the Query API, the calls are identical. That being said, the best place to get started is with the Query API walkthrough. Once you are comfortable with the Query API, the only thing that changes with the Report API is the parameters that you are allowed to send. Take a quick glance at the Report API parameters, and then example code is shown below.
$wufoo_query_vals = array('w_api_key' => 'your api key', 'w_report' => 'report-url');
$url = 'http://username.wufoo.com/api/report/';
// Generate the POST string
foreach($wufoo_query_vals as $key => $value) {
$request .= $key.'='.urlencode($value).'&';
}
// Chop of the trailing ampersand
$request = rtrim($request, '&');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
curl_close ($ch);
echo $response;
Updated : December 18th, 2007