Home > Developer

Storage API : DropTo

DropTo

Script path: /storage/bin/api/dropto.cgi

Description: Handle the dropping of items (files or folders) to one or more email addresses

INPUT (via GET or POST)

   sid => the authenticated session id  (must be valid)

item_list => list of file / folder to drop (must have at least one)
Cannot be too many (current limit: 100 items)
e.g. of items:
/Private/subfolder/thefile.doc
/Company Share/Sales/presentation.ppt

Specify multiple items in multiple cgi parameters of the same name "item_list"

item_list_json => another way of specifying the list of file / folder to drop using the JSON obj.
The JSON obj here is a single member named "item_list" whose value is a list of paths
to file (folder).

{ "item_list" : [ "/Private/subfolder/thefile.doc",
"/Company Share/Sales/presentation.ppt",
"/path/to/sub/item" ] }

item_list and item_list_json can be specified in combination or exclusively of one another.
Both list will be combined internally.

email_list => list of email to dropto / send to. (must have at least one)
Cannot be too many (current limit: 50 recipients)
e.g. of emails:
userid@hostname.com
"AB Chow" <abc@somewhere.org>
NameX <-- will be sent to NameX@domain-of-sender or if it represent the user's
distribution list (in Contacts), it will be replaced with the list's email addresses.

Specify multiple emails in multiple cgi parameters of the same name "email_list"

email_list_json => another way of specifying the list of email addresses to drop to using the JSON obj.
The JSON obj here is a single member named "email_list" whose value is a list of email addresses.

{ "email_list" : [ "userid@hostname.com",
"AB Chow <abc@somewhere.org>",
"NameX" ] }

email_list and email_list_json can be specified in combination or exclusively of one another.
Both list will be combined internally.

msg_subject => email subject line (default if empty)
Cannot be too long (current limit: 100 chars)
Defaults to something like this "Drop File Notification (from SenderName <sender@hostname.com>)"

addmsg => optional short message to be included in email to recipient
can be blank.
Cannot be too long (current limit: 1024 chars)

language => email language (english | chinese_simplified | chinese_traditional | bm )
if null, defaults to the sender's preferred language.


days_valid => N (N number of days to expiry)
defaults to 1 day, range from 1 to 31.

ack_pickup => if equal to 1, then notify sender when there is a dropfile pickup (download)

defaults to NOT notify

ofmt => output format defaults to JSON format with minimal white spaces.
ofmt = jsonp means to produce JSON format in pretty printed way (easier to read)

 

OUTPUT (content-type: text/plain)


    JSON output object:

{

"status" : true | false,

// true only if the API completes successfully
// false if otherwise


"errmsg" : error message, if status is false,

"errcode" : internal error code (alphanumeric),


"sent_to_list" : [ email0, email1, email2, ... ],

// list of emails successfully sent to
// only applicable when status is true


"error_items" : [

{ "isfolder" : is_folder_or_not, "itemname" : path_to_item , "comments" => comment_on_error },

:

:

],

// items (file or folder) that this API had problems accessing.
// This API would have aborted if there is any error here.
// isfolder is true | false



"offending_addrs" :

[

{ email => the email address that has a problem,

reason => the reason for the problem

}

]

// e.g. do not appear to be a an email address.
// or as an alias/nickname, it cannot be expended to the list of emails it represents.
// Currently this API aborts on FIRST email address it has trouble with.

}