There are a few caviots to getting the API working.
I hope this saves someone a few hours/ days.
- CallerServices.php has a small bug
- Only Sandbox email accounts work in the sandbox. Thanks for confiming @ppalavilli
- ALL Sandbox accounts have the First Name: Test Thanks @ppalavilli
- ALL Sandbox accounts have the Last Name: User Thanks @ppalavilli
If you get a
PHP Warning: Missing argument 3 for CallerServices::callWebService()
On line 101 of CallerServices.php you have:
function callWebService($request,$serviceName,$simpleXML)
It should read: //(most of the calls that use callWebService are parent::callWebService( $request,$serviceName ) anyways.
function callWebService($request,$serviceName,$simpleXML=NULL) { $response = null; try { $endpoint=API_BASE_ENDPOINT.$serviceName; $response = call($request, $endpoint, $this->sandBoxEmailAddress,$simpleXML); } catch(Exception $ex) { throw new FatalException('Error occurred in call method'); } return $response; }
Here is the code I used. Replace {email} with one of your sandbox email addresses.
public function verify_email($params){ $VstatusRequest = new GetVerifiedStatusRequest(); $VstatusRequest->emailAddress = '{email}'; $VstatusRequest->matchCriteria = 'NAME'; $VstatusRequest->firstName = 'Test'; $VstatusRequest->lastName = 'User'; $rEnvelope = new RequestEnvelope(); $rEnvelope->errorLanguage = "en_US"; $VstatusRequest->requestEnvelope = $rEnvelope ; $aa = new AdaptiveAccounts(); $response = $aa->GetVerifiedStatus($VstatusRequest); echo json_encode($response); }
The JSON encoded object looks like such:
{"responseEnvelope":{ "timestamp":"2011-03-25T15:37:32.44307:00", "ack":"Success", "correlationId":"42bce847aebc9", "build":"1772158" }, "accountStatus":"VERIFIED" }
@jdavid
Recent Comments