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:file:read

Retrieve a list of MyLibrary folders and their properties for the authorized Constant Contact account. MyLibrary supports a folder hierarchy with 3 levels of nesting. Primary, child (2nd level) and grandchild (3rd level) folders all have the same properties associated with them. This endpoint returns an empty results array if there are no folders in the user's account.

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

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

limit

query

50

Specifies the number of results displayed per page of output, from 1 - 1000, default = 50. See Paginated Output for more information on using limit.

sort_by

query

CREATED_DATE_DESC

Specifies how the list of folders is sorted; valid sort options are:

  • CREATED_DATE - sorts by date folder was added, ascending (earliest to latest)
  • CREATED_DATE_DESC - (default) sorts by date folder was added, descending (latest to earliest)
  • MODIFIED_DATE - sorts by date folder was last modified, ascending (earliest to latest)
  • MODIFIED_DATE_DESC - sorts by date folder was last modified, descending (latest to earliest)
  • NAME - sorts alphabetically by folder name, a to z
  • NAME_DESC - sorts alphabetically by folder name, z to a

Response CodesTOP

code

description

200

Request was successful

401

Authentication failure

406

Unsupported accept header value, must be 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

created_date

string

Date the folder was created, in ISO-8601 format

id

string

Unique ID of the library folder

item_count

integer

Number of files in the library folder

level

integer

Indicates which level the folder resides at:

  • 1 - top level
  • 2 - child or mid level
  • 3 - grandchild or lowest level

modified_date

string

Date the folder was last updated, in ISO-8601 format

name

string (40)

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

{
    "meta": {
        "pagination": {
            "next_link": "/v2/library/folders?next=b2Zmc2V0PTQmbGltaXQ9NA"
        }
    },
    "results": [{
        "id": "-8",
        "name": "backgrounds",
        "level": 1,
        "children": [],
        "item_count": 0,
        "parent_id": "",
        "modified_date": "1970-01-01T00:00:00.000Z",
        "created_date": "1970-01-01T00:00:00.000Z"
    }, {
        "id": "-1",
        "name": "Documents",
        "level": 0,
        "children": [{
            "id": "-10",
            "name": "market_studies",
            "level": 2,
            "children": [],
            "item_count": 0,
            "parent_id": "-1",
            "modified_date": "1970-01-01T00:00:00.000Z",
            "created_date": "1970-01-01T00:00:00.000Z"
        }],
        "item_count": 0,
        "parent_id": "",
        "modified_date": "1970-01-01T00:00:00.000Z",
        "created_date": "1970-01-01T00:00:00.000Z"
    }, {
        "id": "-2",
        "name": "flowers",
        "level": 1,
        "children": [{
            "id": "-7",
            "name": "cactus",
            "level": 2,
            "children": [],
            "item_count": 0,
            "parent_id": "-2",
            "modified_date": "1970-01-01T00:00:00.000Z",
            "created_date": "1970-01-01T00:00:00.000Z"
        }],
        "item_count": 1,
        "parent_id": "0",
        "modified_date": "1970-01-01T00:00:00.000Z",
        "created_date": "1970-01-01T00:00:00.000Z"
    }, {
        "id": "-3",
        "name": "tech",
        "level": 1,
        "children": [],
        "item_count": 0,
        "parent_id": "0",
        "modified_date": "1970-01-01T00:00:00.000Z",
        "created_date": "1970-01-01T00:00:00.000Z"
    }]
}