setLastName("ABC"); $person->addEmailAddress("example..." /> setLastName("ABC"); $person->addEmailAddress("example..." /> setLastName("ABC"); $person->addEmailAddress("example..."/>

I want set variable to xml file in highrise api but it is not work. why?

145 views Asked by At

if i set static values in highrise like this: $person->setFirstName("XYZ"); $person->setLastName("ABC"); $person->addEmailAddress("[email protected]");

it add contact in highrise, but if i use variable instead of static values like this

 $person->setFirstName($fname);
 $person->setLastName($lname);
 $person->addEmailAddress($email);

I got this error: Fatal error: Uncaught exception 'Exception' with message 'API for Person returned Status Code: 422 Expected Code: 201'

What is the problem .please help me any one? Thanks in advance.

1

There are 1 answers

0
AndyGaskell On

I'd try passing the values in with quotes, like...

 $person->setFirstName("\"" . $fname . "\"" );

...also, did you check the email address was valid?