Quantcast
Channel: Discussion Forum > Agent Desktop and Configuration
Viewing all articles
Browse latest Browse all 2270

can not save contact using php connect api (1 Comment)

$
0
0

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.

Version

1

Viewing all articles
Browse latest Browse all 2270

Trending Articles