Overview
Your Extole account has a media library: one set of files that belongs to the account rather than to any campaign. It is separate from the files you upload to a component in one campaign. You list, upload, update, download, and delete library files with the/v4/media-assets endpoints.
My Extole has no page for the media library today, so this API is how you manage it.
Library Files and Campaign Files
The component file endpoints are listed under Components in the API Reference. The media library endpoints are not in the API Reference yet; this page describes them.
Calling the API
Send each call tohttps://api.extole.io with an access token in the Authorization: Bearer header. Create the token in the Security Center.
- A token with the Client Admin access level can call every endpoint below.
- A token with the User Support access level can list, read, and download files, but it cannot upload, update, or delete them.
Each response describes a file with four fields:
id, name, created_date, and updated_date.
Upload a File
Uploads and updates aremultipart/form-data requests with two parts: asset, a JSON object that carries the file’s name, and file, the content.
File Rules
Extole checks every upload and update against these rules and returns a400 error that names the rule when a file breaks one.
- Name: required, up to 255 characters, and unique in your account. Extole stores the name in lowercase, so
Logo.pngis saved aslogo.png. After lowercasing, the name may contain only letters, numbers, dashes, underscores, and periods: no spaces and no folders. - Size: the content must be smaller than 3 MB (3,072,000 bytes) and must not be empty.
- JavaScript: a file whose name ends in
.jsmust be valid JavaScript.
Using a Library File in a Campaign
A creative file or a component setting value refers to a library file by its name with themedia-root:// prefix:
media-root:// with the address of your account’s media library. The reference is to the library’s file, so it is not copied into the campaign.
Every upload, update, or delete in the library publishes a new version of the account’s media library, and a reference resolves to an address in the newest version. Because the reference uses the file’s name, renaming or deleting a file that a campaign refers to leaves that reference pointing at a name the library no longer has.