1. Home
  2. API
  3. Checking For a Successful Request

Checking For a Successful Request

An API request can either by successful or not. The best way to explain how to check for this is through code so let’s go through it.

<?php
$response = $api->get('/levels');
$response = unserialize($response);
if($response['success']==1){
echo 'Request successful';
// do stuff here
} else {
echo 'Request failed';
echo '<br />';
echo 'Error Code:' . $response['ERROR_CODE'];
echo '<br />';
echo 'Error Description:' . $response['ERROR'];
}
?>
Updated on July 11, 2018

Was this article helpful?

Related Articles

Not the solution you were looking for?
Click the link below to submit a support ticket
Submit Ticket