This version of the API docs is depreciated and will be taken offline soon.
Please migrate to the new version as soon as possible to avoid service disruption.
New version can be found at https://docs.wceaapi.org/
Verified uses conventional HTTP response codes to indicate success or failure of an API request.
In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information, and codes in the 5xx range indicate an error with Verified's servers.
Not all errors map cleanly onto HTTP response codes, however. And sometimes the same error code can be returned for multiple reasons.
Whenever a HTTP error response is returned, the payload contains more information about the error. This should help in diagnosing the cause of the error.
If the PHP SDK encounters an error from the API, the return data is a boolean false
.
When that happens, you can get the error message by calling the getError()
method on the SDK class, getError()
will output a detailed array trying to explain what went wrong.
Anatomy of an error array
$data = $API->getUser();if($data == false){ print_r($API->getError()); }else{ // use $data }
---- OUTPUTS ----
array( "errorCode" => 401, //HTTP Code "userMessage" => "Unauthorized.", //HTTP Message "devMessage" => "Something wrong", //Reason for error "more" => "", //Where to obtain more information "applicationCode" => "" //Internal app code )
When calling PUT
and POST
endpoints (addXXXX()
and editXXXX()
), if the payload contains invalid data, data validation messages appear in the form of an array inside the devMessage
key.
array( 'errorCode' => '400', 'userMessage' => 'Bad Request', 'devMessage' => array( 'email' => 'Invalid email address' ), "more" => "" "applicationCode" => "" )