Collection.AddItem - Mozenda


August 10, 2015


Adds an item to a collection with the values specified. Instead of including the single item to be added in the request it is also possible to add items in bulk by attaching a file with the request.

Required parameters


Optional parameters



The ItemID of the newly added item, or an error message stating why it could not be added.

Example request url

Example response

<?xml version="1.0" encoding="utf-8" ?>
<CollectionAddItemResponse   xmlns:xsi=""   xmlns:xsd="">

Bulk Insertion

In addition to adding items one at a time, there is a method that can be used to add items in bulk. Below is some sample C#
code that will demonstrate how this is done. This same technique can be used in many different programming languages to add multiple items to a Mozenda collection at one time.
This option should be used whenever a large number of items need to be inserted all at once.

string webServiceKey = C70E1F84-E12B-4e73-B199-2EE6D43AF44E; //Your Account WebServiceKey.
string collectionID = 1001; //The ID of the destination Collection.
string url = string.Format(
webServiceKey, collectionID);
string fileName = "C:\Temp\NewItems.xml"; //Path to the file containing the items to be uploaded.

WebClient client = new WebClient();
byte[] responseBinary = client.UploadFile(url, fileName);
string response = Encoding.UTF8.GetString(responseBinary);

The image below illustrates the format for each item in the uploaded file.

Need more information?

We'd love to hear from you.

100% Privacy. You are that important to us. Privacy Policy