Transfer APIs
/api/transfer/initialize
Initiates and prepares a new transfer. TransferId, TransferKey and fileserver
information is returned.
apikey
- Text - Your Api Key. Required.
logintoken
- Text - Retrieved by former invocation of /api/authentication/login in order to identify user. Skip this if the user does not have a Filemail Account. Optional.
to
- Text - Comma separated list of recipients (email addresses). Or name of ContactGroup to send to. Optional.
from
- Text - Email address of the person sending the files. Optional.
subject
- Text - Subject of email that is delivered to the recipient(s). Optional. Max 200 chars.
message
- Text - The message inserted in the email to the recipient(s). Optional.
notify
- True/False - Indicates whether you would like a email notification every time a file is downloaded. Optional.
confirmation
- True/False -Indicates whether you would like a email notification after the files have been successfully sent. Optional.
days
- Number - How many days the transfer can be downloaded. Set to default value of account if not specified. Optional.
password
- Text - Sets an additional password on the transfer which is required to download the files. Optional.
transfersize
- Number - Expected size of the entire transfer in bytes (i.e. how many bytes the client expects to upload). Optional.
source
- Text - Devicetype. Optional. Web = Default. Valid alternatives: Web
, Iphone
, Ipad
, WindowsPhone
, WindowsTab
, AndroidPhone
, AndroidTab
, Outlook
, Desktop
Example Request
API Address: https://www.filemail.com
POST /api/transfer/initialize?apikey=asidj98hasdopu9h09sd7h&logintoken=2ac1241817fb4285aa0a1dbd00a21dad
&to=recipient@email.com&subject=Hi&message=Look%20at%20this¬ify=true&confirmation=true&days=10
&password=MySecretPass
Example Response
{
"transferid": "YSEVQIGGNLJFVFP",
"transferkey": "62612b1d95794a87a87e0d6cd4f65a0e",
"transferurl": "http://sl21.filemail.com/api/file/add",
"responsestatus": "ok"
}
/api/transfer/get
Returns files (with urls to retrieve files through HTTP GET) and other information related to the transfer.
apikey
- Text - Retrieved by former invocation of /api/initialize.
Required
transferid
- Text - Id of the transfer. Required.
logintoken
- Text - Retrieved by former invocation of /api/authentication/login in order to identify user. Skip this if the user does not have a Filemail Account. Optional.
filesLimit
- Number - maximum amount of files to return. Optional.
Example Request
API Address: https://www.filemail.com
GET /api/transfer/get?apikey=2ac1241817fb4285aa0a1dbd00a21dad&transferid=HGTUIJBGTRFGJPO&
Example Response
{
"transfer": {
"from": "sender@example.com",
"message": "Hey Tim, here are the files. Give me a holler when you have looked at them.",
"expiredate": 1354138194677,
"downloads": 20,
"sentdate": 1353878994677,
"files": [
{
"filename": "180x500_4_2.swi",
"filesize": 484095,
"downloadurl": "https://www.filemail.com/api/file/get?file...",
"fileid": "d9e234e17c0d49cf872e0f863ec6d87b",
"smallpreview": "https://www.filemail.com/images/icons/...png",
"largepreview": "https://www.filemail.com/images/icons/...png"
},
{
"filename": "test.mp3",
"filesize": 5922685,
"downloadurl": "https://www.filemail.com/api/file/get?file...",
"fileid": "d49e3f6d458343ab93dd64067686acf3",
"smallpreview": "https://www.filemail.com/images/icons/...png",
"largepreview": "https://www.filemail.com/images/icons/...png"
},
{
"filename": "63300102_Østbanebygn_M1etg_MIDL.dwg",
"filesize": 3678804,
"downloadurl": "https://www.filemail.com/api/file/get?file...",
"fileid": "972d75d29a55435480082d3ab2a5d50f",
"smallpreview": "https://www.filemail.com/images/icons/...png",
"largepreview": "https://www.filemail.com/images/icons/...png"
}
],
"notify": true,
"status": "STATUS_COMPLETE",
"id": "qxrfkirjzwjvwbp",
"url": "https://www.filemail.com/d/qxrfkirjzwjvwbp",
"size": 110093096
},
"responsestatus": "OK"
}
/api/transfer/complete
Marks the transfer as Complete and sends out email(s) to receivers. /api/transfer/get can now be invoked and the files can be downloaded.
Example Request
API Address: https://www.filemail.com
POST /api/transfer/complete?apikey=asidj98hasdopu9h09sd7h&logintoken=KDJF9JDF7JFN754H&transferid=HGTUIJBGTRFGJPO
&transferkey=3783hf73h783jhdf83j93k
Example Response
{
"responsestatus": "ok"
"downloadurl": "https://www.filemail.com/d/HGTUIJBGTRFGJPO"
}
/api/transfer/forward
Sends the original email to the given email address(es) and adds the given email address to the list of recipients for the transfer.
Example Request
API Address: https://www.filemail.com
POST /api/transfer/forward?apikey=asidj98hasdopu9h09sd7h&logintoken=203rj9apgu9ka3fq0lap43igvn4ak&transferid=HGTUIJBGTRFGJPO
&transferkey=3783hf73h783jhdf83j93k&to=test@asfasf.no
Example Response
{
"responsestatus": "ok"
}
/api/transfer/cancel
Cancels an unfinished transfer
apikey
- Text - Your Api Key. Required.
transferid
- Text - ID of the transfer. Required.
transferkey
- Text - Key of the transfer. Required.
Example Request
API Address: https://www.filemail.com
POST /api/transfer/cancel?apikey=asidj98hasdopu9h09sd7h&logintoken=KDJF9JDF7JFN754H&transferid=HGTUIJBGTRFGJPO
&transferkey=3783hf73h783jhdf83j93k
Example Response
{
"responsestatus": "ok"
}
/api/transfer/delete
Deletes transfer
apikey
- Text - Your Api Key. Required.
transferid
- Text - ID of the transfer. Required.
logintoken
- Text - Retrieved by former invocation of /api/authentication/login in order to identify user. Required.
Example Request
API Address: https://www.filemail.com
POST /api/transfer/delete?apikey=asidj98hasdopu9h09sd7h&logintoken=KDJF9JDF7JFN754H&transferid=HGTUIJBGTRFGJPO
Example Response
{
"responsestatus": "ok"
}
/api/transfer/compress
Processes files in a transfer and prepares them for being served as a compressed archive. [DEPRECATED]
Example Request
API Address: https://www.filemail.com
POST /api/transfer/compress?apikey=asidj98hasdopu9h09sd7h&transferid=HGTUIJBGTRFGJPO
Example Response
{
"responsestatus": "ok"
}
*addfile*
Files can be added to a transfer after it has been initialized through
/api/initialize. Important: Add files using standard HTTP multipart/form-data
POST to the Url
retrieved by /api/initialize. HTTP 406 will
be returned if the fileserver did not receive the posted file correctly - try to
upload again a few times if this happens.
transferid
- Text - Retrieved by former invocation of /api/initialize. Required.
transferkey
- Text - Retrieved by former invocation of /api/initialize. Required.
thefilename
- Text - the name of the file. Use this if you are unable to properly URL Encode the filename when sending the <filecontent>. Optional.
chunkpos
- Number - The position in the file where the chunk should be written. Required when using chunking, otherwise optional.
md5
- Text - MD5 hash of the filecontent - BASE64 encoded. E.g. 'MmdYzU+gCb+g/PqavfGttA=='. If the calculated hash on our server is different, then HTTP Status 449 is returned - meaning that the chunk must be uploaded again. Optional.
compressed
- True/False - Set to true if the <filecontent> is compressed (zip). Optional.
<filecontent>
- HTTP multipart/form-data POST. The filecontent can be compressed (zip). Required.
Example Request
POST https://sl20.filemail.com/savefile.ashx?transferid=JIRPAXTDQMVAJZB
&transferkey=5812ea4388e24035abe5ba7cb06b3b47 HTTP/1.1
Host: fsdev.filemail.com
Connection: keep-alive
thefilename: Untitled-2.png
Content-Length: 44050
Origin: http://www.filemail.com
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 Chrome/23.0.1271.64 Safari/537.11
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryXY7VW2AbYnFNylnD
Accept: */*
Referer: https://www.filemail.com/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
------WebKitFormBoundaryXY7VW2AbYnFNylnD
Content-Disposition: form-data; name="file"; filename="Untitled-2.png"
Content-Type: image/png
[[[FILECONTENT]]]
------WebKitFormBoundaryXY7VW2AbYnFNylnD--
Example Responsese
HTTP 200 OK
/api/transfer/file/rename
Renames file in a transfer
apikey
- Text - Your Api Key. Required.
logintoken
- Text - Retrieved by former invocation of /api/authentication/login in order to identify user. Required.
fileid
- Text - ID of file to rename. Required.
filename
- Text - New filename. Avoid the characters <
>
:
"
/
\
|
?
*
Required.
Example Request
API Address: https://www.filemail.com">https://www.filemail.com
POST /api/transfer/file/rename?apikey=asidj98hasdopu9h09sd7h&logintoken=KDJF9JDF7JFN754H&fileid=8H6GHn6GBD65290J&filename=NewFile.txt
Example Response
{
"responsestatus": "ok"
}
/api/transfer/file/delete
Removes file from transfer. Remember to also update the ZIP file by invoking /api/ziptransfer after removing files
apikey
- Text - Your Api Key. Required.
logintoken
- Text - Retrieved by former invocation of /api/authentication/login in order to identify user. Required.
fileid
- Text - Id of file to delete. Required.
Example Request
API Address: https://fileserver926.filemail.com
POST /api/transfer/file/delete?apikey=asidj98hasdopu9h09sd7h&logintoken=KDJF9JDF7JFN754H&fileid=8H6GHn6GBD65290J
Example Response
{
"responsestatus": "ok"
}
/api/transfer/update
Updates properties for a transfer
apikey
- Text - Retrieved by former invocation of /api/initialize. Required
logintoken
- Text - Retrieved by former invocation of /api/authentication/login in order to identify user. Required.
transferid
- Text - Id of the transfer. Required.
message
- Text - Updates the message field of the transfer. Optional.
subject
- Text - Updates the subject field of the transfer. Optional.
days
- Number - How many days the transfer can be downloaded. Optional.
downloads
- Number - How many times the transfer can be downloaded. Optional.
notify
- True/False - Indicates whether you would like a email notification every time a file is downloaded. Optional.
Example Request
API Address: https://www.filemail.com
POST /api/transfer/update?apikey=asidj98hasdopu9h09sd7h&logintoken=KDJF9JDF7JFN754H&transferidid=HGTUIJBGTRFGJPO
&message=This%20is%20the%20new%20message&days=30&downloads=100
Example Response
{
"responsestatus": "ok"
}
/api/transfer/sent/get
Returns list of transfers sent by user. If the user is Administrator of a
Filemail Business account - then transfers for all users in the company can be
returned.
InputParameters:
apikey
- Text - Your Api Key. Required.
logintoken
- Text - The logintoken of the authenticated user. Required.
getexpired
- True/False - Option to include expired transfers. Optional. Default: false
getforallusers
- True/False - Option to include transfers sent by all users in a company. Only works for an admin of a Filemail Business account. Optional. Default: false
Example Request
API Address: https://www.filemail.com
GET /api/transfer/sent/get?&apikey=asidj98hasdopu9h09sd7h&logintoken=2ac1241817fb4285aa0a1dbd00a21dad
Example Response
{
"transfers": [
{
"from": "sender4@filemail.com",
"subject": "s2",
"message": "m2",
"expiredate": 1350314399,
"downloads": 22,
"sentdate": 1350055199,
"files": [], //Invoke /api/transfer/get in order to get filelist for this transfer.
"notify": false,
"responsestatus": "STATUS_COMPLETE",
"id": "JZGRNCULDOIMIVL"
}
],
"responsestatus": "OK"
}
/api/transfer/received/get
Returns list of transfers sent to the user's email address. If the user is an Administrator of a Filemail Business account - then transfers sent to all of the company users can be returned.
InputParameters:
-
apikey
- Text - Your Api Key. Required.
-
logintoken
- Text - The logintoken of the authenticated user. Required.
-
getForAllUsers
- True/False - Option to include transfers received by all users in a company. Only works for an admin of a Filemail Business or Enterprise account and when the admin is configured to access other users' files. Optional. Default: false.
-
from
- Number (unixtime in milliseconds since 1970.1.1) - Retrieves transfers received only after this date. When not specified all long-term transfers are returned and regular transfers not older than 90 days. Optional.
Example Request
API Address: https://www.filemail.com
GET /api/transfer/received/get?apikey=asidj98hasdopu9h09sd7h&logintoken=2ac1241817fb4285aa0a1dbd00a21dad
Example Response
{
"transfers": [
{
"subject": "s1",
"message": "m1",
"expiredate": 1350564097,
"downloads": 20,
"sentdate": 1350304897,
"files": [], //Invoke /api/transfer/get in order to get filelist for this transfer.
"notify": false,
"responsestatus": "STATUS_COMPLETE",
"id": "WHVAYVYMFCGUNMT"
}
],
"responsestatus": "OK"
}