Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
 
Go Back   Zimbra - Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra - Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-19-2009, 11:14 PM
Senior Member
 
Posts: 68
Default update or replace address book records using REST

Is there any way to update or replace address book records using a REST upload?

I was looking at modifying the mysql tables directly, but using REST as per the documentation was very easy to set up as a recurring task.

The only problem is that every new upload adds duplicates instead of updating or replacing.

The data sync is one way to zimbra, and nothing is added or changed in zimbra, so as an alternative, wiping all records prior to upload is also an option.
__________________
Mark Hawkins

Medalist
Reply With Quote
  #2 (permalink)  
Old 05-21-2009, 09:32 PM
ljm ljm is offline
Project Contributor
 
Posts: 70
Default use soap

Last I looked the REST API didn't support unique identifers for contacts, so I suspect you can't use it to update/delete.

Another option is the SOAP API, in particular: <ModifyContactRequest>.
__________________
Zindus - contact sync for Thunderbird and Zimbra
Reply With Quote
  #3 (permalink)  
Old 05-21-2009, 10:48 PM
Senior Member
 
Posts: 68
Default

What about just wiping them before upload? Any command I can issue that will wipe all records in the address book? This would accomplish what I'm after.
__________________
Mark Hawkins

Medalist
Reply With Quote
  #4 (permalink)  
Old 05-21-2009, 11:12 PM
ljm ljm is offline
Project Contributor
 
Posts: 70
Default

Via soap, you could call <GetContactsRequest> to get the contact ids, then feed them to <ContactActionRequest> to delete (or move to trash).

If the addressbook is a user-created one rather than the built-in "Contacts" or "Emailed Contacts" then you could:
- find the folder: <SearchRequest>
- delete the folder: <FolderActionRequest>
- create the folder: <CreateFolderRequest>

see soap.txt for a description of the soap methods.
__________________
Zindus - contact sync for Thunderbird and Zimbra
Reply With Quote
Reply


Thread Tools
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

Zimbrablog.com




 

Search Engine Optimization by vBSEO 3.1.0