Difference between revisions of "Zimbra REST API Reference:Import Contacts"

(New page: << Back to Zimbra REST API Reference == REST API Method: Import Contacts == Gets the contacts. === URL === <pre> http://localhost:7070/home/john.d...)
 
(Remove old ZCS_6.0 prefixes)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[ZCS_6.0:Zimbra_REST_API_Reference|<< Back to Zimbra REST API Reference]]
+
{{Template:TabHeader}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference|Introduction]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Folder|Method: Get Folder]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Import_Message|Method: Import Message]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Contacts|Method: Get Contacts]]}}
 +
{{Template:Tab1|[[Zimbra_REST_API_Reference:Import_Contacts|Method: Import Contacts]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Calendar|Method: Get Calendar]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_FreeBusy|Method: Get FreeBusy]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Import_Appointments|Method: Import Appointments]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Tasks|Method: Get Tasks]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Item|Method: Get Item]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Briefcase|Method: Get Briefcase]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Get_Briefcase_Item|Method: Get Briefcase Item]]}}
 +
{{Template:Tab2|[[Zimbra_REST_API_Reference:Export_Mailbox|Method: Export Mailbox]]}}
 +
{{Template:TabFooter}}
 +
 
 +
{{Article Infobox|{{devel}}|{{ZCS 8.0}}|{{ZCS 7.0}}|{{ZCS 6.0}}|}}[[ZCS_6.0:Zimbra_REST_API_Reference|<< Back to Zimbra REST API Reference]]
  
 
== REST API Method: Import Contacts ==
 
== REST API Method: Import Contacts ==
  
Gets the contacts.
+
Import contacts. The default folder is "contacts" but user-defined folders are also supported.
  
 
=== URL ===
 
=== URL ===
Line 10: Line 26:
 
http://localhost:7070/home/john.doe/contacts?{params}
 
http://localhost:7070/home/john.doe/contacts?{params}
 
</pre>
 
</pre>
 +
 +
Go to [[ZCS_6.0:Zimbra_REST_API_Reference#Command_Format|Command Format]]
  
 
=== HTTP Method ===
 
=== HTTP Method ===
  
<pre>
+
<code>POST</code>
POST
 
</pre>
 
  
 
=== Formats ===
 
=== Formats ===
  
<code>csv</code> ([[ZCS_6.0:Zimbra_REST_API_Reference#Response_Formats|Go to Response Formats]])
+
<code>csv,vcf</code> ([[ZCS_6.0:Zimbra_REST_API_Reference#Response_Formats|Go to Response Formats]])
  
 
=== Requires Authentication ===
 
=== Requires Authentication ===
Line 28: Line 44:
  
 
<ul>
 
<ul>
<li><code>fmt</code>. Optional. The response format. Defaults to <code>csv</code>.</li>
+
<li><code>fmt</code>. Required. The import format. Defaults to <code>csv</code>.</li>
<li><code>csvfmt</code>. Optional. If format is <code>csv</code>, optionally select the CSV type which include:
 
<ul>
 
<li>zimbra-csv</li>
 
<li>yahoo-csv</li>
 
<li>thunderbird-csv</li>
 
<li>outlook-2000-csv</li>
 
<li>outlook-2003-csv</li>
 
</ul>
 
</li>
 
<li><code>meta</code>. Optional. If format is <code>tar</code> or <code>tgz</code>, optionally select the CSV type which include. Use <code>meta=1</code> to include meta files, <code>meta=0</code> to not include meta files. If omitted, defaults to <code>meta=1</code>.</li>
 
<li><code>query</code>. Optional. A query keyword.</li>
 
 
</ul>
 
</ul>
  
 
=== Usage Examples ===
 
=== Usage Examples ===
  
Download the contacts as a CSV file:
+
The following examples show using the [http://en.wikipedia.org/wiki/CURL curl] utility to post a file to the REST command. Be sure to replace {username} and {password} with the account username and password.
 +
 
 +
Import contacts from CSV format:
 
<pre>
 
<pre>
http://localhost:7070/home/john.doe/contacts
+
curl -{username}:{password} --upload-file /tmp/mycontacts.csv http://localhost:7070/home/john.doe/contacts?fmt=csv
 
</pre>
 
</pre>
 +
 +
Import contacts from VCF format:
 
<pre>
 
<pre>
http://localhost:7070/home/john.doe/contacts?fmt=csv
+
curl -{username}:{password} --upload-file /tmp/mycontact.vcf http://localhost:7070/home/john.doe/contacts?fmt=vcf
 
</pre>
 
</pre>
  
Retrieve the contacts in XML format:
+
Import contacts from CSV format into the user-defined folder "Contacts > MyBusinessContacts:
 
<pre>
 
<pre>
http://localhost:7070/home/john.doe/contacts?fmt=xml
+
curl -{username}:{password} --upload-file /tmp/mycontacts.csv http://localhost:7070/home/john.doe/contacts/mybusinesscontacts?fmt=csv
 
</pre>
 
</pre>
  
Retrieve the contacts in JSON format:
+
Import contacts from CSV format into the user-defined folder "SalesContacts:
 
<pre>
 
<pre>
http://localhost:7070/home/john.doe/contacts?fmt=json
+
curl -{username}:{password} --upload-file /tmp/mycontacts.csv http://localhost:7070/home/john.doe/salescontacts?fmt=csv
 
</pre>
 
</pre>
  
Download the contacts as a ZIP file:
 
<pre>
 
http://localhost:7070/home/john.doe/contacts?fmt=zip
 
</pre>
 
  
 +
 +
{{Article Footer|Zimbra Collaboration Server 7.0|01/16/2010}}
  
  
{{Article Footer|Zimbra Collaboration Suite 6.0|01/16/2010}}
+
[[Category:REST]]
 +
[[Category:ZCS 7.0]]
 +
[[Category:ZCS 6.0]]
 +
[[Category:Developers]]

Latest revision as of 17:24, 5 August 2014

Introduction  


Method: Get Folder  


Method: Import Message  


Method: Get Contacts  


Method: Import Contacts  


Method: Get Calendar  


Method: Get FreeBusy  


Method: Import Appointments  


Method: Get Tasks  


Method: Get Item  


Method: Get Briefcase  


Method: Get Briefcase Item  


Method: Export Mailbox  


 


Developer Article

Article Information

This article applies to the following ZCS versions.

ZCS 8.0 Article ZCS 8.0 ZCS 7.0 Article ZCS 7.0 ZCS 6.0 Article ZCS 6.0

<< Back to Zimbra REST API Reference

REST API Method: Import Contacts

Import contacts. The default folder is "contacts" but user-defined folders are also supported.

URL

http://localhost:7070/home/john.doe/contacts?{params}

Go to Command Format

HTTP Method

POST

Formats

csv,vcf (Go to Response Formats)

Requires Authentication

true (Go to Authentication)

Parameters

  • fmt. Required. The import format. Defaults to csv.

Usage Examples

The following examples show using the curl utility to post a file to the REST command. Be sure to replace {username} and {password} with the account username and password.

Import contacts from CSV format:

curl -{username}:{password} --upload-file /tmp/mycontacts.csv http://localhost:7070/home/john.doe/contacts?fmt=csv

Import contacts from VCF format:

curl -{username}:{password} --upload-file /tmp/mycontact.vcf http://localhost:7070/home/john.doe/contacts?fmt=vcf

Import contacts from CSV format into the user-defined folder "Contacts > MyBusinessContacts:

curl -{username}:{password} --upload-file /tmp/mycontacts.csv http://localhost:7070/home/john.doe/contacts/mybusinesscontacts?fmt=csv

Import contacts from CSV format into the user-defined folder "SalesContacts:

curl -{username}:{password} --upload-file /tmp/mycontacts.csv http://localhost:7070/home/john.doe/salescontacts?fmt=csv


Verified Against: Zimbra Collaboration Server 7.0 Date Created: 01/16/2010
Article ID: https://wiki.zimbra.com/index.php?title=Zimbra_REST_API_Reference:Import_Contacts Date Modified: 2014-08-05



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search