Create a repository item by calling the RestRepositoryHelper.createItem() method. You can supply a repository ID for the newly created item or you can allow the server to generate a repository ID for you.

A createItem() call returns a data stream that contains all the properties of the created item. This is the same data stream that is returned when you call RestRepositoryHelper.getItem().

The following code sample adds a repository item and allows the server to generate the repository ID:

RestResult result = RestRepositoryHelper.createItem("/atg/commerce/catalog/ProductCatalog", "product",
params, session);

The following code sample adds a repository item and specifies the value of myProductId-12345 as the repository ID:

RestResult result = RestRepositoryHelper.createItem("/atg/commerce/catalog/ProductCatalog", "product",
"myProductId-12345", params, session);
 
loading table of contents...