Our v3 API is now available! Learn more by visiting the v3 developer portal.

Library Folder Collection

Use this endpoint to view (GET) all existing Library folders, and to create (POST) a new folder.

Methods:

Click a method to view its documentation

GET POST

DescriptionTOP

Privileges required: mylibrary:folder:create

Create a new MyLibrary folder by providing the name of the folder and the id of the parent folder if the new folder is to be a child folder (nested in another folder) in the JSON request body. See the example JSON request in the following sections.

POST: https://api.constantcontact.com/v2/library/folders

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

Example JSON Request BodyTOP

{ 
    "name": "wildflowers",
    "parent_id": "-2"
}

Response CodesTOP

code

description

201

Library folder was successfully created

400

Either JSON was malformed or there was a data validation error

401

Authentication failure

406

Unsupported accept header value, must be application/json

409

A folder with that name at this level already exists

415

Unsupported content-type in the header, use application/json

500

Internal server error occurred

StructureTOP

property

type(max length)

description

+ children

array

List of child or grandchild folders within the selected folder, MyLibrary support 3 levels of folder nesting (Read Only)

created_date

string

Date the folder was created, in ISO-8601 format (Read Only)

id

string

Unique ID of the library folder (Read Only)

item_count

integer

Number of files in the library folder (Read Only)

level

integer

Indicates which level the folder resides at:

  • 1 - top level
  • 2 - child or mid level
  • 3 - grandchild or lowest level (Read Only)

modified_date

string

Date the folder was last updated, in ISO-8601 format (Read Only)

name

string (40)

REQUIRED. Name of the library folder, supports only ISO-8859-1 characters (no support for UTF-8 enoding)

parent_id

string

Unique ID of the current folder's parent folder; if the folder is at the top level (not nested), value is null

Example ResponseTOP

{
    "id": "-6",
    "name": "wildflowers",
    "level": 2,
    "children": [],
    "item_count": 0,
    "parent_id": "-2",
    "modified_date": "2013-06-24T13:12:10.000-04:00",
    "created_date": "2013-06-05T09:31:55.000-04:00"
}