Download Log API
With the Download Log API, you can view who downloaded what and when from LiquidFiles.
In difference from most API functions, there's actually 3 versions of the Download Log API, you can either get a Global Download Log for a specific user, a Download Log for a specifc Message or the download Log for a specific FileLink.
Request
Info | Value |
---|---|
Request URL | /downloads /message/_message_id_/downloads /link/_link_id_/downloads |
Request VERB | GET |
Parameter | Type | Description |
---|---|---|
after | Date | Only list Downloads after a certain date (only works for the global /downloads request). |
Parameter | Type | Description |
---|---|---|
id | Integer | The Download ID. |
attachment_id | string | The Attachment ID of the downloaded file. |
message_id | String | If the file was downloaded from a message, this will contain the message_id. |
filelink_id | String | If the file was downloaded from a FileLink, this will contain the filelink_id. |
filename | String | The Filename of the downloaded file. |
size | Integer | The size of the downloaded file. |
content_type | String | The Content-Type of the downloaded file. |
checksum | String | The Checksum (SHA256) of the downloaded file. |
crc32 | String | The CRC32 checksum of the downloaded file. |
downloaded_at | DateTime | The Date and Time when the file was downloaded. |
user_id | String | The user_id of the file owner. |
recipient | String | The recipient that downloaded the file. |
remote_ip | String | The Remote IP address from where the file was downloaded. |
remote_host | String | The Remote Host and Remote IP address from where the file was downloaded. |
download_time | String | The download duration, in seconds. |
download_speed | Integer | The download speed, in bytes per seconds. |
location | String | The Detection Download Location. |
user_agent | String | The User-Agent of the client that downloaded the file. |
browser | String | The Browser of the client that downloaded the file. |
os | String | The Operating System and version of the client that downloaded the file. |
platform | String | The Platform of the client that downloaded the file. |
longitude | Number | The detected longitude from where the file was downloaded. |
latitude | String | The detected latitide from where the file was downloaded. |
country_code | String | The Country Code from where the file was downloaded. |
country_name | String | The Country Name from where the file was downloaded. |
city | String | The City Name from where the file was downloaded. |
region_code | String | The Region Code from where the file was downloaded. |
region_name | String | The Region Name from where the file was downloaded. |
The http response codes are 200 OK if the File Request was successful, and 422 Unprocessable Entity if anything went wrong. In case of an error, there's also an error message with what went wrong.
Example Creating a File Request using curl
curl -X GET --user nkpIxMK9ucUUE7FvfNpdAf:x \
-H "Accept: application/json" \
https://test.host/downloads
API response
{"downloads":[
{
"id":36,
"attachment_id":"0b9gOijTtXAtdqdpb4kjUs",
"message_id":null,
"filelink_id":"JfQg4f0j4dbO1OspMhYZ4a",
"filename":"somefile.ext",
"size":53516,
"content_type":"image/gif",
"checksum":"07dc261df7ff3f428e1f115dfde91ecccd83c9ebb896962918de5a56272141ad",
"crc32":"acb7c906",
"downloaded_at":"2019-01-29T08:56:47.866Z",
"user_id":"user-company-com",
"recipient":"remote@partner.com",
"remote_ip":"192.1.2.4",
"remote_host":"gateway.partner.com (192.1.2.4)",
"download_time":"1.11",
"download_speed":48106,
"location":"Ryde, New South Wales, Australia",
"user_agent":"Safari (12.0.3) - Macintosh (OS X 10.14.3)",
"browser":"Safari (12.0.3)",
"os":"OS X 10.14.3",
"platform":"Macintosh",
"longitude":151.1298,
"latitude":-33.7913,
"country_code":"AU",
"country_name":"Australia",
"city":"Ryde",
"region_code":"NSW",
"region_name":"New South Wales"
}
]}