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

Individual Library Files

Use this endpoint to retrieve (GET) and update (PUT) information for a specific Library file, and to DELETE one or more files. To create (POST) a file, use the Library File Collection POST method.

Methods:

Click a method to view its documentation

GET PUT DELETE

DescriptionTOP

Privileges required: mylibrary:file:update

Use a PUT call to update the following for a file (specified using the fileId path parameter):

  • Update the name
  • Update the description
  • Move a file to another folder, using folder_id to specify the destination folder.

PUT: https://api.constantcontact.com/v2/library/files/{fileId}

Test API

name

type

default

description

api_key

query

REQUIRED; The API key for the application

fileId

path

Specifies the MyLibrary file to update

include_payload

query

TRUE

Determines if updated file's JSON payload is returned :

  • TRUE (default) - successful update returns 200 - Ok and updated JSON payload
  • FALSE - successful update returns 204 - No Content, with the Location header set to the URL of the updated resource

Example JSON Request BodyTOP

{
	"folder_id":"-14",
	"description":"chocolates",
	"name":"IMG_0261.JPG"
}

Response CodesTOP

code

description

200

File(s) was successfully moved

400

Either JSON was malformed or there was a data validation error

401

Authentication failure

404

File with specified ID not found

406

Unsupported accept header value, must be application/json

415

Unsupported content-type in the header, 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 (Read Only)

description

string (100)

REQUIRED. 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 (Read Only)

folder_id

string

Unique ID of the folder the file is in

height

integer

The height in pixels of the image (Read Only)

id

string

Unique ID for the file (Read Only)

is_image

boolean

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

modified_date

string

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

name

string (80)

REQUIRED. Filename and extension

size

integer

The size of the file (in bytes) (Read Only)

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
(Read Only)

+ thumbnail

array

Thumbnail image of the file (Read Only)

url

string

The URL of the file (Read Only)

width

integer

The width (in pixels) of the image (Read Only)

Example ResponseTOP

{
    "name": "IMG_0261.JPG",
    "id": "4",
    "description": "chocolates",
    "folder": "wildflowers",
    "height": 600,
    "width": 800,
    "size": 68825,
    "url": "https://origin.ih.l1.constantcontact.com/fs115/1100310339939/img/4.jpg",
    "source": "MyComputer",
    "status": "Active",
    "thumbnail": {
        "url": "https://origin.ih.l1.constantcontact.com/fs115/1100310339939/img/4.jpg",
        "height": 150,
        "width": 200
    },
    "created_date": "2013-06-19T11:36:43.000-04:00",
    "modified_date": "2013-09-24T13:55:35.000-04:00",
    "folder_id": "-14",
    "is_image": true,
    "file_type": "JPG"
}