Introduction
This guide will walk you through the process of uploading customer data files on Customer Radar portal using the REST API through a secured channel.
The Filedrop is the only API call that doesn't use authentication. The reason is that the Filedrop is used with unauthenticated uploads and therefore doesn't need to be authenticated.
Before uploading your first file, a little bit of background information is required. To upload the actual file to the Customer Radar secured file sharing system, we have two alternate methods.
We can either use:
(a) An HTML form based upload: ​https://secure.customerradar.com/filedrop/transfer
(b) Use straight JSON to upload automatically.
JSON Request
1. Filedrop Info Request
In order to make client side validation possible when sending through a Filedrop, you can start by running a Filedrop Info Request like this:
METHOD: GET
URL: https://secure.customerradar.com/filedrop/transfer
Note: Customer Radar support will provide your unique request URL. Contact them here.
Response Parameters
| Parameter | Type | Description |
| api_key | String | The Filedrop API key, this is used to authenticate uploads. Please note that this is not a persistent API key so you can't count on reusing this over and over again. |
| name | String | The name of the Filedrop. |
| limited_extensions | String | A comma separated list of accepted file extensions. If configured these are the only permitted file extensions you can send through this Filedrop. |
| blocked_extensions | String | A comma separated list of blocked file extensions. If configured these file extensions are not permitted when using this Filedrop. Please note that either limited_extensions or blocked_extensions can be configured, but never both at the same time. |
| max_upload_size | Integer | The maximum file size that will be accepted by the Filedrop in Megabytes. |
This response contains details about the Filedrop that can be used to facilitate the Filetransfer (the Filedrop API key) and the file type and file size limitations so that you can implement client side validations of those without having to upload a file.
Example using curl with response
curl -k -H "Accept: application/json" -H "Content-Type: application/json" https://liquidfiles.company.com/filedrop/test_filedrop
{"filedrop":
{
"api_key":"qiXT9Za7HcXhMTJDBo2oe5",
"name":"Filedrop Test",
"limited_extensions":"doc, docx, xls, xlsx, ppt, pptx, png, gif, jpg, jpeg, pdf, zip",
"blocked_extensions":"",
"max_upload_size":250
}
}
2. Sending files
The Filedrop API key is included in the form data. For instructions how to to upload the file(s), please see the LiquidFiles attachments API. The API key in this instance refers to the Filedrop API key. The purpose of the Filedrop API key is to authenticate the upload. Use the Filedrop Info request above to retrieve the Filedrop API key. Note that as JSON is strictly text based, you must Base64 encode binary data.
Request info
| Info | Value |
| Request URL | /filedrop/_the_filedrop_ |
| Request VERB | POST |
Note: Customer Radar support will provide your unique request URL. Contact them here.
Request Parameters
| Parameter | Type | Description |
| from | String | The email address of the sender. |
| subject | String | The Filedrop Subject. |
| message | String | The Filedrop Message. |
| attachments | Array | An array of all uploaded attachment_id's. |
Example using curl with response
#!/bin/bash
# Some variables
filedrop_server=https://liquidfiles.company.com
filedrop_url=$filedrop_server/filedrop/filedrop_test
# retrieve the Filedrop API key
filedrop_api_key=`curl -H "Accept: application/json" -H "Content-Type: application/json" $filedrop_url | ruby -rjson -e 'puts JSON.parse(STDIN.read)["filedrop"]["api_key"]'`
# Send the file
attachment_id=`curl -X POST -F Filedata=@bigfile.zip --user "$filedrop_api_key:x" $filedrop_server/attachments`
cat <<EOF | curl -s -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d @- $filedrop_url
{"message":
{
"from":"someone@somewhere.com",
"subject":"test subject",
"message":"Here's the file!",
"attachments":["$attachment_id"]
}
}
EOF
3. Response
{
"message": {
"status": "Filedrop message sent successfully" }
}