LiquidFiles Documentation
LiquidFiles Documentation

List Messages and Download Attachments

Deprecation Notice

The XML API is only fully functional on LiquidFiles v2.x that is End of Life and End of Support.

This XML API has been deprecated in favour of the JSON API that's available in LiquidFiles v3.x onwards.

This API was last updated for v2.5.11, please make sure you're running at least this version for all functions to work.

When viewing the available messages, you can view the list if available messages, or view an individual message. Viewing the individual message will also view the files attached to the message.

Viewing available Messages

Request URL: /message
Request VERB: GET
parameters:
sent_after # Date List messages sent after YYYY-MM-DD
sent_in_the_last # Integer List messages sent in the last X number of hours

Response:
messages
id # String The message ID
sender # String The sender of the message
recipients # Array All the specified recpients
ccs # Array All the cc'd recipients
bccs # Array All the bcc'd recipients
created_at # Datetime When the message was created
expires_at # Date When the message expires
authorization # Integer 0: Anyone can download
# 1: Anyone can download after authentication
# 2: Specified Recipients and local users can download
# 3: Only Specified Recipients can download
authorization_description # String The description of the authorization
subject # String The message subject
size # Integer The number of total bytes in the message 

Example using curl

curl -s -X GET --user "$api_key:x" -H 'Content-Type: text/xml' https://test.host/message?sent_in_the_last=24

<?xml version="1.0" encoding="UTF-8"?>
<messages>
  <message>
    <id>1p4EHkeNzM5b2qO7kyNEIy</id>
    <sender>user@example.com</sender>
    <recipients type="array">
      <recipient>recipient@customer.com</recipient>
    </recipients>
    <created_at type="datetime">2011-07-09 06:51:07</created_at>
    <expires_at type="date">2011-07-23</expires_at>
    <authorization>3</authorization>
    <authorization_description>Only Specified Recipients can download</authorization_description>
    <subject>test subject</subject>
<size>1234</size> </message> </messages>

Viewing a message

If you know the message ID (listed above), you can view an individual message.

Request URL: /message/message_id
Request VERB: GET

Response:
messages
id # String The message ID
sender # String The sender of the message
recipients # Array All the specified recpients
ccs # Array All the cc'd recipients
bccs # Array All the bcc'd recipients
created_at # Datetime When the message was created
expires_at # Date When the message expires
authorization # Integer 0: Anyone can download
# 1: Anyone can download after authentication
# 2: Specified Recipients and local users can download
# 3: Only Specified Recipients can download
authorization_description # String The description of the authorization
subject # String The message subject
message # String The body of the message
attachments # Array The attached files
  filename # String The filename
size # Integer The file size in bytes
content_type # String The Content-Type for the file
checksum # String The SHA-256 Checksum of the file
crc32 # String The Crc32 Checksum of the file
url # String The download URL for the file 

Example using Curl

curl -s -X GET --user "$api_key:x" -H 'Content-Type: text/xml' https://test.host/message/1p4EHkeNzM5b2qO7kyNEIy

<message>
  <id>1p4EHkeNzM5b2qO7kyNEIy</id>
  <sender>user@example.com</sender>
  <recipients type="array">
    <recipient>recipient@customer.com</recipient>
  </recipients>
  <created_at type="datetime">2011-07-09 06:51:07</created_at>
  <expires_at type="date">2011-07-23</expires_at>
  <authorization>3</authorization>
  <authorization_description>Only Specified Recipients can download</authorization_description>
  <subject>test</subject>
  <message>test</message>
  <attachments>
    <attachment>
      <filename>secret_image.jpg</filename>
      <size type="integer">18866</size>
      <content_type>image/jpeg</content_type>
<checksum>8c206a1a87599f532ce68675536f0b1546900d7a</checksum>
<crc32>9eca2acc</crc32> <url>https://test.host/message/1p4EHkeNzM5b2qO7kyNEIy/ZfYoatTMcYQLX0qUutOate/A3ohjLyybRyFMj9x65KbzE/secret_image.jpg</url> </attachment> </attachments> </message>

In this example, there's one available attachment. Using the URL, you can download the file. Again, using curl:

curl -s -X GET --user "$api_key:x" -H 'Content-Type: text/xml' https://test.host/message/1p4EHkeNzM5b2qO7kyNEIy/ZfYoatTMcYQLX0qUutOate/A3ohjLyybRyFMj9x65KbzE/secret_image.jpg

Please note that the URL is a one time URL and it will expire after the file has been downloaded. It's not possible to link to individual files without viewing the message.