webservices

Folder Collection and Resource

by Administrator on ‎03-25-2011 10:03 AM

The folders collection represents all folders that a user has in the MyLibrary or MyLibrary+ product.  The collection would return a list of all folders in the account.

 

Request Format

 

 

GET https://api.constantcontact.com/ws/customers/{user-name}/library/folders

Required Headers

   accept: application/atom+xml
   content-type: application/atom+xml

 

For more information about listing folders, refer to Managing Images.

 

Response Format

 

Each <atom:entry> element represents a folder.  A folder's unique ID is given by <id>.  The only detail information you can currently retrieve is the folder name as we currently do not support details of a folder through a folder resource.

 

For more detailed descriptions of the XML elements, refer to the Folder XML Data Elements section.

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom">
<atom:title>Image Folders</atom:title>
<atom:updated>2010-07-01T14:50:52.569-04:00</atom:updated>
<atom:id>tag:api.constantcontact.com,2010:/ws/customers/joesflowers/library/folders</atom:id>
<atom:entry>
<atom:title>Images</atom:title>
<atom:link rel="edit" href="/ws/customers/joesflowers/library/folders/1"/>
<atom:updated>2010-07-01T14:50:52.569-04:00</atom:updated>
<atom:id>tag:api.constantcontact.com,2010:/ws/customers/joesflowers/library/folders/1</atom:id>
<atom:content>
<Folder id="tag:api.constantcontact.com,2010:/ws/customers/joesflowers/library/folders/1">
<Name>Images</Name>
</Folder>
</atom:content>
</atom:entry>
<atom:entry>
<atom:title>Images</atom:title>
<atom:link rel="edit" href="/ws/customers/joesflowers/library/folders/1"/>
<atom:updated>2010-07-01T14:50:52.569-04:00</atom:updated>
<atom:id>tag:api.constantcontact.com,2010:/ws/customers/joesflowers/library/folders/2</atom:id>
<atom:content>
<Folder id="tag:api.constantcontact.com,2010:/ws/customers/joesflowers/library/folders/2">
<Name>Spring Campaign</Name>
</Folder>
</atom:content>
</atom:entry>
</atom:feed>

Request Format

 

POST https://api.constantcontact.com/ws/customers/{user-name}/library/folders

Required Headers

   accept: application/atom+xml
   content-type: application/atom+xml

 

To learn more about creating a folder, please refer to the Managing Images.

 

You need to specify in the XML body the name of the folder you want to create.  Use the following XML as the template:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<atom:entry xmlns:atom="http://www.w3.org/2005/Atom">
<atom:content>
<Folder>
<Name>Folder Name</Name>
</Folder>
</atom:content>
</atom:entry>

For more detailed descriptions of the XML elements, refer to the Folder XML Data Elements section.

 

Folder Resource

 

The folder resource represents individual folders that contain images.  You need to use the folder resource to get a list of images in a folder.

 

The folder resource is represented by the following URI:

 

https://api.constantcontact.com/ws/customers/{user-name}/library/folders/{folder-id}
 

We have not implemented the folder resource, however, so no HTTP methods are currently allowed on the folder itself.  You will receive 405: Method Not Allowed error.

 

URI Format


URI Component Description
user-name

The account owner's Constant Contact user name.
Value must be in lower case.

folders

Represent a collection of folders that contain images.
folder-id

Represents an individual folder. 

This value can be obtained by looking at the last component of the URI in "href" attribute of <atom:link> element.  It is not the value from <atom:id> element.

 

Folder Data XML Elements Specifications


Element Name Allowed Values Updatable? Required on POST Required on PUT Notes
Name


Less than 80 characters. All characters other than \\ / : * ? \ < > |


No (Update is not supported yet) Yes Not Supported We do not support updating the folder name yet.