示例#1
0
 public void inviteContact(ContactItem contact, String invitationMessage, String type)
 {
     try
     {
         ContactApi    contactApi  = new ContactApi(session.GetApiClient());
         List <String> contactKeys = new List <String>();
         contactKeys.Add(contact.Key);
         InviteUsersInput  input  = new InviteUsersInput(type, null, invitationMessage, contactKeys);
         InviteUsersResult result = contactApi.InviteUsers(input);
         if (result.Hdr.Rc != 0)
         {
             throw new Exception("Error while inviting contact key " + contact.Key);
         }
     }
     catch (Exception ex)
     {
         throw new Exception("Error while inviting contactkey " + contact.Key, ex);
     }
 }