To use the APIs, you need to pass your API key.
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'
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'
Pass the API key as the username (without password) using HTTP basic authentication.
curl 'https://[email protected]/web/v1/device'
To use the API, you need to have a unique device_key in your cookie or query parameters.
curl -c $COOKIE_FILE "https://send-anywhere.com/web/v1/device?api_key=$API_KEY&profile_name=Send%20Anywhere%20SDK"
To send files, create an 6-digit KEY then you'll get a target link to upload files.
$.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.
});
To receive files, query an 6-digit KEY then you'll get a target link to download files.
$.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.
});
We support JSONP which can be used by passing a callback parameter in the query string of the URL you are requesting.
The base URL for API endpoints is:
https://send-anywhere.com
- 200 - OK
- 400 - Bad Request. Invalid request query string.
- 403 - Forbidden. Invalid
api_key
. - 404 - Not Found. Invalid
key
- 429 - Too Many Request. To keep the amount of spam on Send Anywhere as low as possible.
- 500 - Internal Server Error. Something went wrong on our side. We're very sorry.
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 |
Generate a 6-digit key
for sending files.
Parameters | |
---|---|
file | File list |
Request Cookies | |
---|---|
device_key | Unique device key |
Response | |
---|---|
key | Generated key |
weblink | Upload URL |
{
"file":[ { "name": "file1.txt", "size": 1}, { "name": "file2.txt", "size": 2} ]
}
{
"key":"123456",
"weblink":"https://file.send-anywhere.com/api/webfile/123456"
}
Query a 6-digit key
for receiving files.
Request Cookies | |
---|---|
device_key | Unqiue device key |
Response | |
---|---|
key | Requested key |
weblink | Download URL |
{
"key":"123456",
"weblink":"https://file.send-anywhere.com/api/webfile/123456"
}