| Author |  | 
      
        | bravedave Newbie
 
  
 
 Joined: 05 September 2014
 Location: Australia
 Online Status: Offline
 Posts: 35
 | 
          In the API Function there is GetContactItems
           | Posted: 05 September 2014 at 12:26am | IP Logged |   |  
           | 
 |  
 It accepts a search parameter, what format can it take
 
 I looking for a way to get all the contacts that have been modified since a given date (part of a export import routine from my application
 
 thanks in advance
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          That's just a search string, works the same way as you'd enter some search pattern on Contacts screen and hit Enter. It doesn't offer any options like those you're looking for, I'm afraid.
           | Posted: 05 September 2014 at 1:55am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | bravedave Newbie
 
  
 
 Joined: 05 September 2014
 Location: Australia
 Online Status: Offline
 Posts: 35
 | 
          Is there another way to do this
           | Posted: 15 September 2014 at 3:29pm | IP Logged |   |  
           | 
 |  
 Basically I have contacts from several sources (including an Exchange Server)
 
 Importing them is ok, but I want to know if a contact has been modified (perhaps on an iPhone etc) so I can reverse sync those contacts
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          We've rechecked this, and seems like there are actually DateCreated and DateModified properties of contact object; they were not included into helper for some reason though - but you should still be able to use that information.
           | Posted: 16 September 2014 at 3:01am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | bravedave Newbie
 
  
 
 Joined: 05 September 2014
 Location: Australia
 Online Status: Offline
 Posts: 35
 | 
          Thanks, but I can get as far as looking up the formation
           | Posted: 16 September 2014 at 4:34am | IP Logged |   |  
           | 
 |  eg. by email
 
 
| Code: 
 
    
    | 
      
       | $oApiContactsManager = CApi::Manager('contacts');
 $contact = $oApiContactsManager->GetContactByEmail( $iUserId, 'email@domain.com' );
 
 |  |  |  
 I can SQL query the database and get the id's of the contacts, and process that way - but that requires SQL access, a query through the API is what is needed
 
 What would be ideal is
 
 
| Code: 
 
    
    | 
      
       | $oApiContactsManager = CApi::Manager('contacts');
 $contacts = $oApiContactsManager->GetContacts( $iUserId, 'lastmodified > <unixdate>' );
 
 |  |  |  
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          You can only get that information for a specific contact, so it's about getting all the contacts and checking date properties of the object one at a time.
           | Posted: 16 September 2014 at 4:38am | IP Logged |   |  
           | 
 |  
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  |