add_contact

Document created by Gutis Champion on Feb 27, 2016Last modified by Gutis Champion on Feb 27, 2016
Version 2Show Document
  • View in full screen mode

SPEL API methods

add_contact

 

This method allows to create new contact

 

Definition:

add_contact( uuid, ... );

uuid - user id

... - name-value pairs for the attributes to update "atribute1", "value1","atribute2", "value2"

 

working example:

This example will create contact with administrator access type

uuid who;  
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");  
who=msg[0];  
send_wait(0, top_object(), "call_attr", "api", "add_contact", who, "userid", "Admin", "last_name", "Adminuser", "access_type", 10002);
 if (msg_error()) {
   logf(ERROR, "get_failed %s",msg[0]);
 }
}
1 person found this helpful

Attachments

    Outcomes