Topic by wang jin
Content
I want create a contact using php connect api, So I wrote code in customer portal as below :
$contact = new RNCPHP\Contact();
$contact->Title = "";
//add email addresses
$email_addr=$zykh."@com.invalid";
$contact->Emails = new RNCPHP\EmailArray();
$contact->Emails[0] = new RNCPHP\Email();
$contact->Emails[0]->AddressType=new RNCPHP\NamedIDOptList();
$contact->Emails[0]->AddressType->LookupName = "Email - Primary";
$contact->Emails[0]->Address = "12345@com.com";
$contact->save();
when the php run , it shows error message as below:
Invalid ID:ID could not be resolved from the lookupName[Email - Primary];
But the php connect api document wrote code like this,what's wrong with my code? Can you give me some suggestion? thank you.