View Single Post
  #1 (permalink)  
Old 07-20-2006, 09: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