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

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 Search this Thread Display Modes
  #1 (permalink)  
Old 07-20-2006, 08:57 PM
ljm ljm is offline
Project Contributor
 
Posts: 81
Default wierdness when importing contacts with the REST API

Hi, I'm seeing an odd thing when using the REST API to import contacts.

The attached contacts.csv.txt (.txt suffix so that it be attached to this forum thread) contains 20 rows plus a header row.

When I import it via:
curl -u userassword --data-binary @/tmp/contacts.csv.txt \
http://zimbra.example.com/service/ho...ntacts?fmt=csv

I only see the first 16 contacts inside zimbra. That's the case whether I log i via the web-based UI, or suck them out again using http GET. I can only see 16 "blah ... mailbox - UserServlet (POST) ... blah" lines in /opt/zimbra/log/zimbra.log Stopping and starting zimbra doesn't help.

But, if I split this one file into 20 files, each with one line of header and one line of contact, and import each file separately:
for i in contact-part-*; do
curl -u userassword --data-binary @/tmp/$i \
http://zimbra.example.com/service/ho...ntacts?fmt=csv
done
it works as expected. 20 contacts in zimbra.

I originally began working with 500 contact lines in a .csv, where zimbra took the first 16, skipped some, took a few more and so on. Out of 500-odd contacts it imported maybe 30-odd.

I'm happy with the workaround, just thought I'd post for interest.
Attached Files
File Type: txt contacts.csv.txt (15.2 KB, 216 views)
Reply With Quote
  #2 (permalink)  
Old 07-20-2006, 09:34 PM
Zimbra Employee
 
Posts: 228
Default

I noticed that some lines ended with:

...-home-web-page,

and (5 to be exact) did not:

...-home-web-page

If I added a ',' to the end of all them then all 20 import in one shot.

I need to do a little more research to figure out if it is a bug or not, but it sounds like it might be.

Can you please a bug report?

thanks.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #3 (permalink)  
Old 07-20-2006, 10:23 PM
ljm ljm is offline
Project Contributor
 
Posts: 81
Default trailing commas required

Looks like when importing a .csv file via the REST API, if the file contains consecutive lines without a trailing comma, the first of these lines is imported but subsequent lines without a trailing comma are not.

Bug filed as:
http://bugzilla.zimbra.com/show_bug.cgi?id=9282
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.