forked from sparkapi/sparkapi4p2
-
Notifications
You must be signed in to change notification settings - Fork 0
Check for API Error Codes
donclem edited this page Jul 6, 2012
·
2 revisions
When making various calls in the PHP API Client, you may want to check for any error codes that may come up (due to various handling issues). The documented Error Codes are available here.
$resultscheck = $api->GetListings();
if ($resultcheck === false) {
echo "API Error Code: {$api->last_error_code}<br>\n";
echo "API Error Message: {$api->last_error_mess}<br>\n";
exit;
} else {
// enter outcome here if successful call (for example print_r($resultscheck);)
}