Return Values

I've got my php form passing the appropriate variables to the client.create api.

However, what stumps me is how to parse the response code so that I can code my 'if' clauses (i.e. if there is an error display the appropriate message or if there is no error, write the clientID returned to a variable)

Here's a sample of the output I get (when I output $result to screen):

Array ( [anyType] => Array ( [Code] => 150 [Message] => Email address already in use by another client ) )

Thanks in advance for any assistance anyone is able to provide.

blastcontact, 8 years ago

Got a solution from Ben at CM (Thanks!) - Here it is if anyone else wasn't sure how to parse the response array:

if($result['Result']['Code'] == 0)
               echo 'Success';
       else
               echo 'Error : ' . $result['Result']['Message'];

Thanks again Ben!

200,000 companies around the world can't be wrong.

From Australia to Zimbabwe, and everywhere in between, companies count on 
Campaign Monitor for email campaigns that drive real business results.

Get started for free
1-888-533-8098