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, 7 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!

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098