Library File Collection Endpoint

Use this endpoint to retrieve (GET) a collection of Library files in the Constant Contact account. To add a file to the collection, see Library File Multipart POST API.

Methods:

Click a method to view its documentation

GET

DescriptionTOP

Privileges required: mylibrary:file:read

The following options  are available when retrieving Library files:

  • Retrieve all files in all folders in the account - do not use any query parameters (except for api_key)
  • Retrieve all files with a specific type - use the type query parameter (ALL, IMAGE, or Document)
  • Retrieve all files from a specific source - use the source query parameter
  • Retrieve a specific file type from a specific source - use both the type and source query parameters

There are many options available for sorting the JSON response using the sort_by query parameter.

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

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 files is sorted; valid sort options are:

  • CREATED_DATE - sorts files by date created, ascending (earliest to latest)
  • CREATED_DATE_DESC - (default) sorts files by date created, descending (latest to earliest)
  • MODIFIED_DATE - sorts by date the file was last modified, ascending (earliest to latest)
  • MODIFIED_DATE_DESC - sorts by date the file was last modified, descending (latest to earliest)
  • NAME - sorts files alphabetically by name, a to z
  • NAME_DESC - sorts files alphabetically by name, z to a
  • SIZE - sorts by file size, smallest to largest
  • SIZE_DESC - sort by file size, largest to smallest
  • DIMENSION - sorts by file dimensions (hxw), smallest to largest
  • DIMENSION_DESC - sorts by file dimensions (hxw), largest to smallest

source

query

ALL

Specifies to retrieve files from a particular source:

  • ALL - (default) files from all sources
  • MyComputer
  • Facebook
  • Instagram
  • Shutterstock
  • Mobile

type

query

ALL

Specifies the type of files to retrieve, ALL, IMAGES, or DOCUMENTS

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

created_date

string

Date the file was added to MyLibrary, in ISO-8601 format

description

string (100)

Description of the file provided by user

file_type

string

Specifies the file type, valid values are: JPEG, JPG, GIF, PDF, PNG

folder

string (80)

Name of the folder the file is in

folder_id

string

Unique ID of the folder the file is in

height

integer

The height in pixels of the image

id

string

Unique ID for the file

is_image

boolean

Identifies whether the file is an image (true) or not (false)

modified_date

string

Date the file was last updated in MyLibrary, in ISO-8601 format

name

string (80)

Filename and extension

size

integer

The size of the file (in bytes)

source

string

Indicate the source of the original file; image files can be uploaded from the following sources

  • MyComputer
  • Facebook - MyLibrary Plus customers only
  • Instagram - MyLibrary Plus customers only
  • Shutterstock
  • Mobile

status

string

Indicates the file status:

  • Active - file is available for use
  • Processing - file is in the process of being uploaded to account
  • Uploaded - file has been uploaded, but not yet available for use
  • VirusFound - virus scan during upload detected a virus, upload cancelled
  • Failed - file upload failed
  • Deleted - file was deleted from MyLibrary

+ thumbnail

array

Thumbnail image of the file

url

string

The URL of the file

width

integer

The width (in pixels) of the image

Example ResponseTOP

{
    "meta": {
        "pagination": {}
    },
    "results": [
        {
            "name": "IMG_0341.JPG",
            "id": "9",
            "description": "buildings_steel",
            "folder": "wildflowers",
            "height": 612,
            "width": 792,
            "size": 304560,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/9.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/9.jpg",
                "height": 154,
                "width": 200
            },
            "created_date": "2013-09-26T10:52:46.000-04:00",
            "modified_date": "2013-09-26T12:32:41.000-04:00",
            "folder_id": "-1",
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0268.JPG",
            "id": "8",
            "description": "buildings_glass",
            "folder": "wildflowers",
            "height": 480,
            "width": 640,
            "size": 114637,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/8.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/8.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:51:59.000-04:00",
            "modified_date": "2013-09-26T12:32:41.000-04:00",
            "folder_id": "-1",
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0267.JPG",
            "id": "7",
            "description": "daisy_snow2",
            "folder": "images",
            "height": 600,
            "width": 800,
            "size": 42217,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/7.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/7.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:51:28.000-04:00",
            "modified_date": "2013-09-26T10:51:28.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0266.JPG",
            "id": "6",
            "description": "daisy_snow",
            "folder": "images",
            "height": 600,
            "width": 800,
            "size": 39952,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/6.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/6.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:50:55.000-04:00",
            "modified_date": "2013-09-26T10:50:56.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0255.JPG",
            "id": "5",
            "description": "wrestler_compete2",
            "folder": "images",
            "height": 240,
            "width": 320,
            "size": 118608,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/5.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/5.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:50:06.000-04:00",
            "modified_date": "2013-09-26T10:50:06.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0256.JPG",
            "id": "4",
            "description": "wrestler_compete1",
            "folder": "images",
            "height": 240,
            "width": 320,
            "size": 119043,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/4.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/4.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:49:25.000-04:00",
            "modified_date": "2013-09-26T10:49:25.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0257.JPG",
            "id": "3",
            "description": "wrestler_compete",
            "folder": "images",
            "height": 320,
            "width": 240,
            "size": 130761,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/3.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/3.jpg",
                "height": 200,
                "width": 150
            },
            "created_date": "2013-09-26T10:48:45.000-04:00",
            "modified_date": "2013-09-26T10:48:45.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0248.JPG",
            "id": "2",
            "description": "profile_left",
            "folder": "images",
            "height": 480,
            "width": 640,
            "size": 152592,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/2.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/2.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:47:02.000-04:00",
            "modified_date": "2013-09-26T10:48:10.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        },
        {
            "name": "IMG_0250.JPG",
            "id": "1",
            "description": "bio_photo",
            "folder": "images",
            "height": 480,
            "width": 640,
            "size": 121559,
            "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/1.jpg",
            "source": "MyComputer",
            "status": "Active",
            "thumbnail": {
                "url": "https://origin.ih.l1.constantcontact.com/fs134/1100394770946/img/1.jpg",
                "height": 150,
                "width": 200
            },
            "created_date": "2013-09-26T10:46:27.000-04:00",
            "modified_date": "2013-09-26T10:46:27.000-04:00",
            "folder_id": null,
            "is_image": true,
            "file_type": "JPG"
        }
    ]
}