Thank you for completing the API request form.
One of our representatives will get in touch with you shortly.
OKDocumentation
Wondering how to use the Send Anywhere API?
Then you should check out the following pages:
Desktop SDK
API Setup
Download SDK
You can download the SDK from our Github.
Build SDK
To set up Send Anywhere's SDK and see example projects you need to install CMake and then run CMake in your SDK root path.
$ cmake .
CMake is a cross-platform, open-source build system. If you're new to CMake, please visit the official guide to Running CMake.
Examples
Check out more examples at our GitHub.
Initialize
void sendanywhere_init(const char* apiKey, const char* tokenPath); void sendanywhere_cleanup();
void sendanywhere_init(const char* apiKey, const char* tokenPath);
Initialize Send Anywhere library.
| Parameters | |
|---|---|
| apiKey | Your API key. |
| tokenPath | A token path for saving session. |
void sendanywhere_cleanup()
Cleanup library.
Create task
SendAnywhereTask sendanywhere_create_send(
const wchar_t* files[],
unsigned int fileNumber);
SendAnywhereTask sendanywhere_create_receive(
const wchar_t* key,
const wchar_t* destDirPath);
void sendanywhere_close(SendAnywhereTask task);SendAnywhereTask sendanywhere_create_send(const wchar_t* files[], unsigned int fileNumber)
Initialize Send Anywhere library.
| Parameters | |
|---|---|
| files | Files to send. |
| fileNumber | Number of file. |
| Return | |
|---|---|
| value | A handle to new task. |
SendAnywhereTask sendanywhere_create_receive(const wchar_t* key, const wchar_t* destDirPath)
Start task for sending or receiving. Initialize Send Anywhere library.
| Parameters | |
|---|---|
| key | The KEY of sender. |
| destDirPath | Save path. |
| Return | |
|---|---|
| value | A handle to new task. |
void sendanywhere_close(SendAnywhereTask task)
Close a handle.
| Parameters | |
|---|---|
| task | A Handle to the task. |
Control task
void sendanywhere_start(SendAnywhereTask task); bool sendanywhere_is_running(SendAnywhereTask task); void sendanywhere_wait(SendAnywhereTask task); void sendanywhere_cancel(SendAnywhereTask task);
void sendanywhere_start(SendAnywhereTask task)
Start task for sending or receiving.
| Parameters | |
|---|---|
| task | A Handle to the task. |
bool sendanywhere_is_running(SendAnywhereTask task)
Indicates whether the task is running.
| Parameters | |
|---|---|
| task | A Handle to the task. |
| Return | |
|---|---|
| value | True if the task is running, false otherwise. |
void sendanywhere_wait(SendAnywhereTask task)
Wait until task is finished.
| Parameters | |
|---|---|
| task | A Handle to the task. |
void sendanywhere_cancel(SendAnywhereTask task)
Cancel the task to stop.
| Parameters | |
|---|---|
| task | A Handle to the task. |
Listener for task
typedef void (*sendanywhere_listener_function)( SendAnywhereState state, SendAnywhereDetailedState detailedState, const void* param, void* userptr); void sendanywhere_set_listner( SendAnywhereTask task, sendanywhere_listener_function func, void* userptr);
typedef enum {
SENDANYWHERE_STATE_UNDEFINED,
SENDANYWHERE_STATE_FINISHED,
SENDANYWHERE_STATE_ERROR,
SENDANYWHERE_STATE_PREPARING,
SENDANYWHERE_STATE_TRANSFERRING,
SENDANYWHERE_STATE_NOTIFICATION,
} SendAnywhereState;
typedef enum {
SENDANYWHERE_DETAILED_STATE_UNDEFINED,
SENDANYWHERE_DETAILED_STATE_FINISHED_SUCCESS,
SENDANYWHERE_DETAILED_STATE_FINISHED_CANCEL,
SENDANYWHERE_DETAILED_STATE_FINISHED_ERROR,
SENDANYWHERE_DETAILED_STATE_ERROR_WRONG_API_KEY,
SENDANYWHERE_DETAILED_STATE_ERROR_SERVER,
SENDANYWHERE_DETAILED_STATE_ERROR_NO_REQUEST,
SENDANYWHERE_DETAILED_STATE_ERROR_NO_EXIST_FILE,
SENDANYWHERE_DETAILED_STATE_ERROR_FILE_NO_DOWNLOAD_PATH,
SENDANYWHERE_DETAILED_STATE_ERROR_FILE_NO_DISK_SPACE,
SENDANYWHERE_DETAILED_STATE_ERROR_NO_EXIST_KEY,
SENDANYWHERE_DETAILED_STATE_PREPARING_UPDATED_KEY,
SENDANYWHERE_DETAILED_STATE_PREPARING_UPDATED_FILE_LIST,
SENDANYWHERE_DETAILED_STATE_TRANSFERRING,
} SendAnywhereDetailedState;typedef struct {
const wchar_t* name;
const wchar_t* fullPath;
unsigned long long size;
unsigned long long sent;
} SendAnywhereTransferFileInfo;
typedef struct {
unsigned int number;
SendAnywhereTransferFileInfo* fileInfo;
} SendAnywhereAllTransferFileInfo;void sendanywhere_set_listner(SendAnywhereTask task, sendanywhere_listener_function func, void* userptr);
Register a callback to be invoked when transfer event occurs.
typedef void (sendanywhere_listener_function)(SendAnywhereState state, SendAnywhereDetailedState detailedState, const void param, void* userptr);
| SendAnywhereState (SENDANYWHERE_STATE_) | SendAnywhereDetailedState (SENDANYWHERE_DETAILED_STATE_) | param |
|---|---|---|
| FINISHED | FINISHED_SUCCESS | - |
| FINISHED_CANCEL | - | |
| FINISHED_ERROR | - | |
| ERROR | ERROR_WRONG_API_KEY | - |
| ERROR_SERVER | - | |
| ERROR_NO_REQUEST | - | |
| ERROR_NO_EXIST_FILE | - | |
| ERROR_NO_EXIST_KEY | - | |
| ERROR_FILE_NO_DOWNLOAD_PATH | - | |
| ERROR_FILE_NO_DISK_SPACE | - | |
| ERROR_FILE_DISK_NOT_MOUNTED | - | |
| PREPARING | PREPARING_UPDATED_KEY | const wchar_t* |
| PREPARING_UPDATED_FILE_LIST | const SendAnywhereAllTransferFileInfo* | |
| TRANSFERRING | TRANSFERRING | const SendAnywhereTransferFileInfo* |
Flow Step
- PREPARING_UPDATED_KEY
- PREPARING_UPDATED_FILE_LIST
- TRANSFERRING
- TRANSFERRING
- ...
- TRANSFERRING
- TRANSFERRING
- FINISHED_SUCCESS
- FINISHED_CANCEL
- ERROR
- FINISHED_ERROR
iOS SDK
Setup for development
Download SDK
You can download the SDK from our Github.
You can download the UI SDK from our Github.
Configure Xcode
1. Drag and Drop SendAnywhereSDK-iphoneuniversal/SendAnywhereSDK.framework into your Project Navigator Group.
2. Set SAAPIKey value in .plist file with your Send Anywhere API key.
3. Following frameworks and libraries:
- SystemConfiguration.framework
- CoreTelephony.framework
- libstdc++.dylib
- libz.dylib
Examples
Check out more examples in our GitHub.
Task Constructor
@interface SASendTask : SATask
- (instancetype)initWithFileUrls:(NSArray *)urls;
@end
@interface SAReceiveTask : SATask
- (instancetype)initWithKey:(NSString *)key destDirPath:(NSString *)destDirPath;
@end
SASendTask
| Parameters | |
|---|---|
| urls | The file list to send |
ReceiveTask
| Parameters | |
|---|---|
| key | The KEY for sending files |
| destDirPath | The folder path for receiving files |
Public method
@interface SATask : NSObject
- (void)start;
- (void)await;
- (void)cancel;
@end
static void init(String key)
Set your API key.
| Parameters | |
|---|---|
| key | Your API Key. |
void start()
Start a task for sending or receiving files.
void await()
Wait until the task is finished.
void cancel()
Stop and cancel the running task.
Delegate for task
@protocol SATaskDelegate <NSObject>
- (void)task:(SATask *)task transferPreparing:(SAPreparingDetailState)state;
- (void)task:(SATask *)task fileInfo:(id<SAFileInfo>) fileInfo transferring:(SATransferDetailState)state;
- (void)task:(SATask *)task transferFinished:(SAFinishedDetailState)state;
- (void)task:(SATask *)task error:(SAErrorDetailState)state;
@end
Delegate for prepared transfering
- (void)task:(SATask *)task transferPreparing:(SAPreparingDetailState)state;
typedef NS_ENUM(NSInteger, SAPreparingDetailState) {
SAPreparingDetailUndefined,
SAPreparingDetailUpdatedKey,
SAPreparingDetailUpdatedFileList,
};
Delegate for transfering
- (void)task:(SATask *)task fileInfo:(id<SAFileInfo>) fileInfo transferring:(SATransferDetailState)state;
typedef NS_ENUM(NSInteger, SATransferDetailState) {
SATransferDetailTransferring,
};
- (void)task:(SATask *)task transferFinished:(SAFinishedDetailState)state;
typedef NS_ENUM(NSInteger, SAFinishedDetailState){
SAFinishedDetailUndefined,
SAFinishedDetailSuccess,
SAFinishedDetailCancel,
SAFinishedDetailError
};
Delegate for error
- (void)task:(SATask *)task error:(SAErrorDetailState)state;
typedef NS_ENUM(NSUInteger, SAErrorDetailState) {
SAErrorDetailUndefined,
SAErrorDetailWrongAPIKey,
SAErrorDetailServer,
SAErrorDetailNoRequest,
SAErrorDetailNoExistFile,
SAErrorDetailFileNoDownloadPath,
SAErrorDetailFileNoDiskSpace,
SAErrorDetailNoExistKey,
};
Flow Step
-
SAPreparingDetailUpdatedKey
-
SAPreparingDetailUpdatedFileList
-
SATransferDetailTransferring
-
SATransferDetailTransferring
-
...
-
SATransferDetailTransferring
-
SATransferDetailTransferring
-
SAFinishedDetailSuccess
-
SAFinishedDetailCancel
-
SAFinishedDetailError
typedef NS_ENUM(NSInteger, SAFinishedDetailState){
SAFinishedDetailUndefined,
SAFinishedDetailSuccess,
SAFinishedDetailCancel,
SAFinishedDetailError
};
typedef NS_ENUM(NSUInteger, SAErrorDetailState) {
SAErrorDetailUndefined,
SAErrorDetailWrongAPIKey,
SAErrorDetailServer,
SAErrorDetailNoRequest,
SAErrorDetailNoExistFile,
SAErrorDetailFileNoDownloadPath,
SAErrorDetailFileNoDiskSpace,
SAErrorDetailNoExistKey,
};
- SAPreparingDetailUpdatedFileList
- SATransferDetailTransferring
- SATransferDetailTransferring
- ...
- SATransferDetailTransferring
-
SATransferDetailTransferring
- SAFinishedDetailSuccess
- SAFinishedDetailCancel
- SAFinishedDetailError
File Information
@protocol SAFileInfo <NSObject>
@property (nonatomic, readonly) NSURL *url; // File URL
@property (nonatomic, readonly) NSString *pathName; // Relative file path
@property (nonatomic, readonly) long long transferSize; // transfered file size in bytes
@property (nonatomic, readonly) long long totalSize; // file size in bytes
@end
Android SDK
Setup for development
Download SDK
You can download the SDK from our Github.
You can download the UI SDK from our Github.
Configure Android Studio
1. Copy SDK, sendanywhere Dirctory to Project.
2. Import SDK project as dependency in android studio.
3. Set your API key.
Task.init("YOUR_API_KEY") Examples
Check out more examples in our GitHub.
Task Constructor
public class SendTask extends Task {
public SendTask(Context context, File[] files);
...
}
public class ReceiveTask extends Task {
public ReceiveTask(Context context, String key, File destDir);
...
}SendTask(Context context, File[] files)
| Parameters | |
|---|---|
| context | The current context. |
| files | The file list what you want to send. |
ReceiveTask(Context context, String key, File destDir)
| Parameters | |
|---|---|
| context | The current context. |
| key | The KEY of sender. |
| destDir | Save folder. |
Public method
public class Task {
...
public static void init(String key);
public void start();
public void await();
public void cancel();
...
}static void init(String key)
Set your API key.
| Parameters | |
|---|---|
| key | Your API Key. |
void start()
Start task for sending or receiving.
void await()
Wait until task is finished.
void cancel()
Cancel the task to stop.
Listener for task
public class Task {
...
public interface OnTaskListener {
void onNotify(int state, int detailedState, Object obj);
}
public void setOnTaskListener(OnTaskListener callback)
...
}public class Task {
...
public class State {
public static final int UNKNOWN;
public static final int FINISHED;
public static final int ERROR;
public static final int PREPARING;
public static final int TRANSFERRING;
}
public class DetailedState {
public static final int UNKNOWN;
public static final int FINISHED_SUCCESS;
public static final int FINISHED_CANCEL;
public static final int FINISHED_ERROR;
public static final int ERROR_WRONG_API_KEY;
public static final int ERROR_SERVER;
public static final int PREPARING_UPDATED_KEY;
public static final int PREPARING_UPDATED_FILE_LIST;
public static final int TRANSFERRING;
}
...
}public class SendTask extends Task {
...
public class DetailedState extends Task.DetailedState {
public static final int ERROR_NO_REQUEST;
public static final int ERROR_NO_EXIST_FILE;
}
...
}public class ReceiveTask extends Task {
...
public class DetailedState extends Task.DetailedState {
public static final int ERROR_NO_EXIST_KEY;
public static final int ERROR_FILE_NO_DOWNLOAD_PATH;
public static final int ERROR_FILE_NO_DISK_SPACE;
public static final int ERROR_FILE_DISK_NOT_MOUNTED;
}
...
}public void setOnTaskListener(OnTaskListener callback)
Register a callback to be invoked when transfer event occurs.
void onNotify(int state, int detailedState, Object obj)
| Task.State | Task.DetailedState | param |
|---|---|---|
| FINISHED | FINISHED_SUCCESS | - |
| FINISHED_CANCEL | - | |
| FINISHED_ERROR | - | |
| ERROR | ERROR_WRONG_API_KEY | - |
| ERROR_SERVER | - | |
| ERROR_NO_REQUEST | - | |
| ERROR_NO_EXIST_FILE | - | |
| ERROR_NO_EXIST_KEY | - | |
| ERROR_FILE_NO_DOWNLOAD_PATH | - | |
| ERROR_FILE_NO_DISK_SPACE | - | |
| ERROR_FILE_DISK_NOT_MOUNTED | - | |
| PREPARING | PREPARING_UPDATED_KEY | String |
| PREPARING_UPDATED_FILE_LIST | Task.FileInfo[] | |
| TRANSFERRING | TRANSFERRING | Task.FileInfo |
Flow Step
- PREPARING_UPDATED_KEY
- PREPARING_UPDATED_FILE_LIST
- TRANSFERRING
- TRANSFERRING
- ...
- TRANSFERRING
- TRANSFERRING
- FINISHED_SUCCESS
- FINISHED_CANCEL
- ERROR
- FINISHED_ERROR
File Information
public class Task {
...
public class FileInfo {
public File getFile();
public String getPathName();
public long getTransferSize();
public long getTotalSize();
}
...
}File getFile()
Return the File object
String getPathName()
Return the File object
long getTransferSize()
Returns the transfer size in bytes.
long getTotalSize()
Return the size of the file in bytes.
Web API
Authentication
To use the APIs, you need to pass your API key.
Ways to Pass Your Key
1. HTTP Header
Pass the API key into the X-Api-Key header.
curl -H 'X-Api-Key: YOUR_API_KEY' 'https://send-anywhere.com/web/v1/device'
2. Get Query Parameter
Pass the API key into the api_key GET query string parameter.
curl 'https://send-anywhere.com/web/v1/device?api_key=YOUR_API_KEY'
3. HTTP Basic Auth Username
Pass the API key as the username (without password) using HTTP basic authentication.
curl 'https://YOUR_API_KEY@send-anywhere.com/web/v1/device'
Register Device
To use the API, you need to have a unique device_key in your Cookies.
curl -c $COOKIE_FILE "https://send-anywhere.com/web/v1/device?api_key=$API_KEY&profile_name=Send%20Anywhere%20SDK"
Send files
To send files, create an 6-digit KEY then you'll get a target link to upload files.
Request Sample (with jQuery)
$.ajax({url: 'https://send-anywhere.com/web/v1/key',
type: 'GET',
dataType: 'jsonp',
api_key: YOUR_API_KEY
cache: false
}).done(function (data) {
// `data.key` is an 6-digit KEY.
// `data.weblink` is a target link.
});
Receive files
To receive files, query an 6-digit KEY then you'll get a target link to download files.
Request Sample (with jQuery)
$.ajax({url: 'https://send-anywhere.com/web/v1/key/' + 123456,
type: 'GET',
dataType: 'jsonp',
api_key: YOUR_API_KEY,
timeout: 3000,
cache: false
}).done(function (data) {
// data.weblink is a target link.
});
Cross Domain Request
We support JSONP which can be used by passing a callback parameter in the query string of the URL you are requesting.
Example
Check out more examples in our GitHub.
The base URL for API endpoints is:
https://send-anywhere.com
HTTP Response Status
| 200 | OK |
| 400 | Bad Request. Invalid request query string. |
| 403 | Forbidden. Invalid
api_key. |
| 404 | Not Found. Invalid
key |
| 429 | Many Request. To keep the amount of spam on Send Anywhere as low as possible. |
| 500 | Server Error. Something went wrong on our side. We're very sorry. |
GET /web/v1/device
Create an unique device_key for your client. If device_key already exists, just update the device.
| Parameters | |
|---|---|
| profile_name | Client device name |
| Response Cookies | |
|---|---|
| device_key | Unique device key |
GET /web/v1/key
Generate a 6-digit
key for sending files.
| Request Cookies | |
|---|---|
| device_key | Unique device key |
| Response | |
|---|---|
| stringkey | Generated key |
| stringweblink | Upload URL |
Response Sample
{
"key": "123456"
"weblink": "https://file.send-anywhere.com/api/webfile/123456"
}
/web/v1/key/{KEY}
Query a 6-digit
key for receiving files.
| Request Cookies | |
|---|---|
| device_key | Unqiue device key |
| Response | |
|---|---|
| stringkey | Requested key |
| stringweblink | Download URL |
Response Sample
{
"key": "123456"
"weblink": "https://file.send-anywhere.com/api/webfile/123456"
}
Web Widget
Copy. Paste. Transfer.
Add the Web Widget to your website or blog post. It's quick and easy!
After selecting the size and type, click the 'Generate' button.
Then copy the generated code and paste it between <body> and </body>.
Generate
1. Include the platform.js on your page once - ideally right after the opening <body> tag.
2. Place the code for your Widget where you want the Widget to appear on your page.

Widget generator is only avalible on desktop site
Request an API Key
Sign up for the Send Anywhere API and embed the simplest file sharing service in your website or application.