Get started
API Endpoint
https://fawapi.filesanywhere.com/api/v1/
A Web API, or Web Application Programming Interface, is a set of rules and protocols allowing different software applications to communicate over the Internet in a distributed environment. It defines the methods and data formats that applications can use to request and exchange information. Web APIs are typically based on HTTP (Hypertext Transfer Protocol) and can return data in various formats, such as JSON, XML, or others.
Our new ASP.NET Web API support enables you to easily create powerful Web APIs that can be accessed from a broad range of clients (ranging from browsers using JavaScript, to native apps on any mobile/client platform).
Web APIs typically expose a set of endpoints, which are URIs that different clients, such as web, mobile, or desktop, can call to perform specific operations, such as retrieving or submitting data.
The FilesAnywhere Web API (FAWAPI) provides a simple web services interface to your FilesAnywhere account. The API (Application Programming Interface) enables your FilesAnywhere account to be integrated with applications and web sites using the standard web services protocol.
The API is freely available for commercial or non-commercial use by any Professional or Enterprise plan.
API Access
To access the API, you need to have an API key.
Using your web browser, log into your FilesAnywhere Admin Console. On the left, click on Site Configuration and then click on Developer API Key. Then click on the "Generate Key" button.
Authentication
# Here is a javascript example
function logintest()
{
var item = {
"clientId": 215,
"userName": 'Testuser',
"password": 'password'
};
fetch('https://fawapi.filesanywhere.com/api/v1/auth/login', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var authToken = result.data.token;
var deviceId = result.data.mfaDataModel.mfaUniqueId;
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
});
})
.catch(error => {
// Handle any errors here
});
}
This method logs you into your FilesAnywhere account and starts an API session. It returns back a Token ID which must be used for subsequent API calls.
To authenticate, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/auth/login
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
api_key |
String |
Your API key. |
clientId |
Integer |
Private site client id for a FilesAnywhere private site.
|
username |
String |
FilesAnywhere username to log in into FilesAnywhere account.
|
password |
String |
FilesAnywhere account password
|
ipAddress |
String |
(optional) IP address of client machine
|
LOGIN RESPONSE
Field |
Type |
Description |
token |
String |
An authentication Token ID to be used in subsequent API calls |
isPasswordExpired |
Boolean |
If the password is expired then the auth token will not be generated. The user will need to reset the password by invoking resetpassword API.
|
passwordKey |
String |
In case password is expired then using this password key user can reset his password by invoking resetpassword API
|
mfaApplied |
Boolean |
If MFA is enabled for logged in user, then user will not get token, user needs to validate MFA OTP using his respective delivery method.
|
mfaDataModel |
String |
If MFA is enabled, then it will return MFA attributes, this needs to deserialize in json
|
mfaDataModel.mfaUniqueId |
String |
Unique ID which will be used in subsequent API call to validate MFA OTP
|
mfaDataModel.mfaMethod |
Integer |
On UI, user can select delivery method for MFA OTP, possible values are
0 - MFA Not Applied |
MFA is not applied for this user |
1 - User defined |
On UI, User need to choose which delivery method will be set for MFA authentication, either it can be Email/SMS/Phone Call or Authenticator app. |
2 - Verification code |
On UI, user will prompt to enter verification code, which will be sent to his delivery method |
3 - Phone number |
On UI, user need to provide phone number input (as MFA phone number is not set for this user yet), on which verification code will be sent |
5 - Authenticator App |
On UI, user need to provide QR code along with verification code as an input, e.g. mfaDataModel.mfaQRCode -> Base 64 QR code scanner image, mfaDataModel.mfaqrSecret - QR code secret code, mfaDataModel.mfaQrIssuer - QR code issuer name |
|
mfaDataModel.mfaDeliveryMethod |
Integer |
Delivery method for MFA OTP, possible values are 0=None; 1=User Defined; 2=SMS; 3=PhoneCall; 4=Email; 11= Authenticator App
|
mfaDataModel.mfaDestinationSource |
String |
MFA destination source, e.g. if user selected delivery method as SMS/Phone Call, then it will return phone number, if user selected delivery method as email, then it will return email id
|
refreshToken |
String |
When existing auth token is expired, then we can get a new token by invoking ‘RefreshToken’ API
|
refreshTokenTOTPSecret |
String |
While using ‘RefreshToken’ API, need to pass TOTP code generated by user using this secret key.
|
userId |
Integer |
User’s Id, which will be passed in subsequent API call as X-UserId in request header
|
RefreshToken
# Here is a javascript example
function getRefreshToken()
{
var item = {
"refreshToken": 'tokenvalue',
"TOTP": '233425' // User need to generate time based OTP using refreshTokenTOTPSecret value receive from login API
};
fetch('https://fawapi.filesanywhere.com/api/v1/auth/refreshToken', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var authToken = result.data.token;
var deviceId = result.data.mfaDataModel.mfaUniqueId;
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
});
})
.catch(error => {
// Handle any errors here
});
}
Once user login successfully, user will receive authentication Token, RefreshToken and refreshTokenTOTPSecret. When API token is expired, then we need to call ‘RefreshToken’ API to get new Token.
To get new authentication token, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/auth/refreshtoken
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyZWZyZXNoQ2xpZW50SWQiOiIyMTUiLCJyZWZyZXNoVXNlcklkIjoiMiIsInJlZnJlc2hVc2VySWRlbnRpdHkiOiI3YzZhOGI2My0yNDUyLTQzMTQtYmIxNC02OTkwNzZhY2RmYmIiLCJuYmYiOjE3NDExNjg5MTMsImV4cCI6MTc0Mzc2MDkxMywiaWF0IjoxNzQxMTY4OTEzLCJpc3MiOiJGaWxlc0FueXdoZXJlIn0.GbsydsdKQPWtmd7AtcqA-8wlHMvKD8Stc158SnoLs9E",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6IjIxNSIsInVzZXJOYW1lIjoiSkFMUEVTSDIxNSIsInVzZXJJZCI6IjIiLCJpc0FkbWluIjoiZmFsc2UiLCJpc0Ftb3VudER1ZSI6IkZhbHNlIiwicm9sZSI6IlVzZXIiLCJsaW5rVHlwZSI6IiIsImxpbmtJZCI6IiIsImxpbmtFeHRyYUluZGV4SWQiOiIiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3VzZXJkYXRhIjoiIiwidXNlcklkZW50aXR5IjoiN2M2YThiNjMtMjQ1Mi00MzE0LWJiMTQtNjk5MDc2YWNkZmJiIiwibmJmIjoxNzQxMTY4OTA1LCJleHAiOjE3NDEyNTUzMDUsImlhdCI6MTc0MTE2ODkwNSwiaXNzIjoiRmlsZXNBbnl3aGVyZSJ9.oGNIUDZDeOWiRpO7eU7Gqekpwj9wcnRVib79pfZVbLw"
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
refreshToken |
String |
RefreshToken received from Login response API |
tOtp |
String |
User need to generate time based OTP using refreshTokenTOTPSecret value receive from Authentication Endpoint
|
RESPONSE
Field |
Type |
Description |
token |
String |
An authentication Token ID to be used in subsequent API calls |
refreshToken |
String |
When existing auth token is expired, then we need to use this token to get a new auth token.
|
MFA Verification
# Here is a javascript example
function mfaVerification() {
var item = {
"mfaUniqueId": "204VAU03UEUJP8RZ8AA05S1SMUBQCL3R331WF399F002",
"clientId": 215,
"userName": "testuser",
"mfaDeliveryMethod": 2,
"verificationCode": "234362"
};
fetch('https://fawapi.filesanywhere.com/api/v1/auth/mfaverification', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var token = result.data.token;
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
When MFA is enabled for user, user needs to validate OTP received in his delivery method either in SMS/E-mail/Phone call or in Authenticator app.
To verify OTP, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/auth/mfaverification
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"timeZone": "India Standard Time",
"isPasswordExpired": false,
"regionToken": null,
"regionURL": null,
"errorResponse": null,
"mfaDeliveryMethod": 0,
"authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJZCI6IjIxNSIsInVzZXJOYW1lIjoiSkFMUFNURVNUIiwidXNlcklkIjoiMTkwOTQiLCJpc0FkbWluIjoiZmFsc2UiLCJpc0Ftb3VudER1ZSI6IkZhbHNlIiwicm9sZSI6IlVzZXIiLCJsaW5rVHlwZSI6IiIsImxpbmtJZCI6IiIsImxpbmtFeHRyYUluZGV4SWQiOiIiLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3VzZXJkYXRhIjoiIiwidXNlcklkZW50aXR5IjoiMWVkODNiMjQtYzUxNC00MzNiLTlhMmMtZTQyODFhMjBlNWMzIiwibmJmIjoxNzQxMjUyMDk1LCJleHAiOjE3NDEzMzg0OTUsImlhdCI6MTc0MTI1MjA5NSwiaXNzIjoiRmlsZXNBbnl3aGVyZSJ9.QIfT8w1zSfycRdn9xuPe9qry0_g2IClxqY0sK-qvybc",
"data": null,
"isOldUIDefault": false,
"folderOnLogin": 0,
"lastAccessedFolderKey": null,
"loginSelectFolderPathKey": null,
"passwordKey": null,
"adminLoginId": 0,
"theme": 0,
"refreshToken": null,
"refreshTokenTOTPSecret": null
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
mfaUniqueId |
String |
Unique ID which will be receive after successful execution of Authentication Endpoint, in parameter -> data.mfaDataModel.mfaUniqueId |
clientId |
Integer |
Client Id (Organization id)
|
userName |
String |
Account logged in user name
|
mfaDeliveryMethod |
Integer |
Verification code sent to this delivery method, possible values are
0=None; 1=User Defined; 2=SMS; 3=PhoneCall; 4=Email; 11= Authenticator App
|
verificationCode |
String |
Verification code will be receive in user’s delivery method e.g. SMS/Email/Phone call/Authenticator app
|
RESPONSE
Field |
Type |
Description |
authToken |
String |
An authentication Token ID to be used in subsequent API calls |
timeZone |
String |
User's timezone.
|
isPasswordExpired |
Boolean |
If user's password is expired then it will return true, user needs to reset his password.
|
Send Verification Code
# Here is a javascript example
function sendVerificationCode() {
var item = {
"mfaUniqueId": "DECH7RAFUYBW55AXWGME83APAJ4R95F55I3SPXT7670E",
"clientId": 215,
"userName": "testuser",
"mfaDeliveryMethod": 4,
"mfaEmail": "testfaw@domain.com"
};
fetch('https://fawapi.filesanywhere.com/api/v1/auth/sendverificationcode', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var token = result.data.token;
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
When MFA is enabled for user, and user needs to send verification code or resent verification code to his own delivery method either SMS/Email/PhoneCall using this API method.
To send verification code, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/auth/sendverificationcode
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"clientId": 215,
"userName": "userTest",
"ipAddress": null,
"mfaDeliveryMethod": 4,
"verificationCode": null,
"httpUserAgent": null,
"mfaUniqueId": "DECH7RAFUYBW55AXWGME83APAJ4R95F55I3SPXT7670E",
"mfaDestinationSource": null,
"mfaEmail": "test@abc.com",
"mfaPhoneSMS": null,
"mfaPhoneCall": null,
"mfaPhone": null,
"name": null
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
mfaUniqueId |
String |
Unique ID which will be receive after successful execution of Authentication Endpoint, in parameter -> data.mfaDataModel.mfaUniqueId |
clientId |
Integer |
Client Id (Organization id)
|
userName |
String |
Account logged in user name
|
mfaDeliveryMethod |
Integer |
Verification code sent to this delivery method, possible values are
0=None; 1=User Defined; 2=SMS; 3=PhoneCall; 4=Email; 11= Authenticator App
|
mfaEmail |
String |
If mfaDeliveryMethod is passed as 4 (email), then need to send email address, else no need to pass this parameter. Verification code will be sent to this email address.
|
mfaPhone |
String |
Phone number which can be prompt from user when no phone number is set. Provide same phone number in ‘MFAPhoneSMS’ or ‘MFAPhoneCall’ parameter. Verification code will be sent to this phone number.
|
mfaPhoneSMS |
String |
If mfaDeliveryMethod is 2 (SMS), then pass phone number in this parameter.
|
mfaPhoneCall |
String |
If mfaDeliveryMethod is 3 (PhoneCall), then pass phone number in this parameter.
|
Get SSO URL
# Here is a javascript example
function getSSOURL() {
var item = {
"emailAddress": "test@abc.com"
};
fetch('https://fawapi.filesanywhere.com/api/v1/sso/getssourl', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
return response.json(); // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(error);
});
})
.then(data => {
// Process the response data here
console.log(data); // Example: Logging the data to the console
})
.catch(error => {
// Handle any errors here
console.error(error); // Example: Logging the error to the console
});
}
This method provides you login URL of Single Sign-On interface of user, which can be used to take the credential of user.
To get SSO URL, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/sso/getssourl
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"loginUrl": "https://private.filesanywhere.com/lite/ssoredirect?url=http%3a%2f%2flocalhost%2fdev-qa%2f%2fsaml20.aspx%3fRelayState%3d%26c%3d215",
"clientId": clientid
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
emailAddress |
String |
This is the email address configured in Identity provider (Active Directory, OneLogin, etc.) for user’s identity. |
RESPONSE
Field |
Type |
Description |
loginURL |
String |
Login URL to be used for authentication with Identity provider of user. |
clientId |
Integer |
ClientID of company in which user belongs to.
|
Validate SSO Identity
# Here is a javascript example
function validateSSO() {
var item = {
"samlResponse": "sampresponsetoken",
"clientid": 215
};
fetch('https://fawapi.filesanywhere.com/api/v1/sso/validatessoidentity', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var token = result.data.authenticatedUser.token;
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This method logs you in to your FilesAnywhere account using SAML 2.0 security token and starts an API session. It returns back a Authentication Token which must be used for subsequent API calls.
To get SSO URL, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/sso/validatessoidentity
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
samlResponse |
String |
This is the SAML 2.0 security token received from identity provider (Active Directory Federation Service, OneLogin etc.) for FilesAnywhere application after authentication. |
clientId |
Integer |
ClientID of company in which user belongs to.
|
RESPONSE
Field |
Type |
Description |
token |
String |
Authentication token which will be used in subsequent API calls |
refreshToken |
String |
Get new auth token using this refresh token when current auth token is expired.
|
refreshTokenTOTPSecret |
String |
Generate OTP using this secret code
|
Update Password
# Here is a javascript example
function changePassword() {
var item = {
"clientId": 215,
"passwordKey": "QMlDR5+CL5BleteFxHJIcA==",
"password": "Password"
};
fetch('https://fawapi.filesanywhere.com/api/v1/password/updatepassword', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'db8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var token = result.data.token;
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
When user’s password is expired, then from Authentication Endpoint, user will not get authentication token, however from response of Authentication Endpoint, user can get password key which will be used to change user’s password.
To update expired password, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/Password/updatepassword
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
clientId |
Integer |
ClientID of company in which user belongs to.
|
passwordKey |
String |
Password key will be received from Authentication Endpoint if user’s password is expired. |
password |
String |
New changed password |
RESPONSE
Field |
Type |
Description |
token |
String |
Authentication token which will be used in subsequent API calls |
Get item list
# Here is a javascript example
function getProviderEntries() {
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries?Path=/&Page=1&EntryType=1&SortColumn=Type&SortOrder=0', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId': 2,
'Authorization': 'bearer eyJhbGciOiJ...' //auth token
}
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Get sub folder/file list of selected path
To get file/folder list of selected path, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"exploreObjects": [{
"key": "92658E4E-42E9-4A40-B310-E7E1064C7BDA.jpeg",
"displayText": "92658E4E-42E9-4A40-B310-E7E1064C7BDA.jpeg",
"entryType": 1,
"entryTypeDisplayText": "Image",
"lastModified": "2022-02-16T03:47:43.3731344",
"sizeBytes": 49194,
"size": "48 KB",
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": {
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": "/",
"displayLocation": "\\",
"displayKey": "\\92658E4E-42E9-4A40-B310-E7E1064C7BDA.jpeg",
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
{
"key": "adobe1.png",
"displayText": "adobe1.png",
"entryType": 1,
"entryTypeDisplayText": "Image",
"lastModified": "2024-09-19T09:30:28.3947432",
"sizeBytes": 35406,
"size": "34.6 KB",
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": {
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": "/",
"displayLocation": "\\",
"displayKey": "\\adobe1.png",
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
{
"key": "gs:29224",
"displayText": "JALPSFS",
"entryType": 0,
"entryTypeDisplayText": "File folder",
"lastModified": null,
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": {
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": true,
"groupSharePermission": 5,
"groupShareBy": "Jalpesh Ee",
"groupShareByUserId": 13087,
"groupShareCreatedOn": "2024-08-05T20:33:46.227",
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": "\\",
"displayKey": "\\JALPSFS",
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
}],
"hasMorePages": false,
"storageProviderType": 6,
"providerSupportsCopy": true,
"providerSupportsMove": true,
"providerSupportsRename": true,
"providerSupportsDelete": true,
"providerSupportsShare": true,
"providerSupportsDownload": false,
"providerSupportsPreview": false,
"providerSupportsSnapshots": false,
"breadcrumb": {
"links": [{
"text": "",
"id": 0,
"key": "",
"active": true
}]
},
"key": "/",
"displayLocation": "\\",
"continuationToken": null,
"nextContinuationToken": "|2",
"current": null,
"page": 1,
"count": 100,
"totalResults": 25,
"pageTokens": null,
"isSearchResult": false,
"includeFiles": false,
"allowMultiSelect": false,
"allowFolderSelect": false,
"restrictToPermissions": null
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
QUERY PARAMETERS
Field |
Type |
Description |
path |
String |
Path to get sub folder/file list, e.g / => root, test/ => get sub items of test folder, gs:2345/ => get sub items of group shared folder
|
page |
Integer |
(Optional - default : 1) Page number |
entryType |
Integer |
(Optional - default : 0 for folder, 1 for file) |
sortColumn |
String |
(Optional - default : "Name"), list items sorting by given value, e.g. Name, Type, Size, Date |
sortOrder |
String |
(Optional - default : "asc"), list items sorting order by given value, e.g. asc, desc |
Create folder
# Here is a javascript example
function createFolder() {
var item = {
"key": "test/",
"folderName": "testdx"
};
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/folders/create', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId': 2,
'Authorization' : 'bearer eyJhbGciOiJIUz..'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Add a new folder into user’s account.
To create a new folder in user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/folders/create
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
key |
String |
Path where the folder needs to be created. This key is recieved from the above Get Item List API from data.exploreObjects[0].key.
|
folderName |
String |
Newly created folder name |
RESPONSE
Field |
Type |
Description |
success |
Boolean |
Return true when successfully created a folder. |
Delete files/folders
# Here is a javascript example
function deleteFolders() {
var item = {
"keys" : [ { "key" : "/- FileShare/2024-09-20/14.10.14/", "EntryType": "0"}, { "key" : "/- FileShare/2024-09-20/14.28.59/", "EntryType": "0"} ]
}
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/folders/delete', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId': 2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Delete multiple files/folders from user's account.
To delete items from user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/folders/delete
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
keys |
String[] |
List of keys of files/folders which need to be deleted, e.g. [{key: "92658E4E-42E9-4A40-B310-E7E1064C7BDA.jpeg", entryType: 1}, {key: "adobe1.png", entryType: 1}]
|
RESPONSE
Field |
Type |
Description |
success |
Boolean |
If items are successfully deleted, then it will return true |
Rename a file
# Here is a javascript example
function renamefile() {
var item = {
"key": "gs:29222/OCRTest (6).docx",
"name": "OCRTest (7).docx"
};
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/files/rename', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Renames a file in user's account.
To rename a file in user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/files/rename
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
key |
String |
File's key, this key will be receive from above 'providerentries' API from data.exploreObjects[0].key
possible values are / => root, test/ => test folder, gs:2345/ => inside group shared folder gs:share id
|
name |
String |
Updated file's name |
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when successfully changed file's name |
Rename a folder
# Here is a javascript example
function renamefolder() {
var item = {
"key": "/form3",
"name": "form33"
};
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/folders/rename', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Renames a folder in user's account.
To rename a folder in user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/folders/rename
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
key |
String |
Folders's key, this key will be receive from above 'providerentries' API from data.exploreObjects[0].key
possible values are / => root, test/ => test folder, gs:2345/ => inside group shared folder gs:share id
|
name |
String |
Updated folder's name |
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when successfully changed folder's name |
Copy files/folders
# Here is a javascript example
function copyItems() {
var item = {
"sourceKeys" : [ { "key" : "test/Awspackger1.png", "EntryType": "0"}, { "key" : "test/Awspackger21.png", "EntryType": "0"}],
"destinationKey": "Post/",
"move": false
}
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/folders/copy', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Copy files/folders in user's account.
To copy files/folders in user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/folders/copy
Result example :
{
"success": true,
"processedAsync": true,
"asyncTaskId": "ec38763e-7455-462f-9f68-3d9ce8ed446f",
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
sourceKeys |
List |
List of keys of files/folders, e.g. [{key: "testfolder/", entryType: 0}, {key: "adobe1.png", entryType: 1}] |
destinationKey |
String |
Destination folders's key where files/folders need to be copied. Possible values are / => root, test/ => test folder (its a item's 'key' parameter, which can be acquired from 'Get File/Folder List' API)
|
move |
Boolean |
For copy operation pass this value as false |
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when successfully copied items. |
Move files/folders
# Here is a javascript example
function moveItems() {
var item = {
"sourceKeys" : [ { "key" : "test/Awspackger1.png", "EntryType": "0"}, { "key" : "test/Awspackger21.png", "EntryType": "0"}],
"destinationKey" : "Post/",
"move": true
}
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/folders/copy', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Move files/folders in user's account.
To move files/folders in user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/folders/copy
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
sourceKeys |
List |
List of keys of files/folders, e.g. [{key: "testfolder/", entryType: 0}, {key: "adobe1.png", entryType: 1}] |
destinationKey |
String |
Destination folders's key where files/folders need to be moved. Possible values are / => root, test/ => test folder (its a item's 'key' parameter, which can be acquired from 'Get File/Folder List' API)
|
move |
Boolean |
For move operation pass this value as true |
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when items moved successfully |
Get Tags/Notes of items
# Here is a javascript example
function getItemDescription() {
var item = {
"items" : [ { "key" : "/- FileShare/2024-09-20/14.46.25/", "EntryType": "0"}, { "key" : "/- FileShare/2024-09-20/14.51.43/", "EntryType": "0"}]
}
fetch('https://fawapi.filesanywhere.com/api/v1/common/GetListItemsData', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Get tags/notes of selected items, along with it return favorite indication of items.
To get tags/notes of selected items, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/common/GetListItemsData
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"data": [
{
"key": "/- FileShare/2024-09-20/14.46.25/",
"comments": [],
"tags": [
"testtag"
],
"note": "note`",
"favorite": false
},
{
"key": "/- FileShare/2024-09-20/14.51.43/",
"comments": [],
"tags": [
"tgs1"
],
"note": "nttest\r\n12",
"favorite": false
}
]
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
keys |
String[] |
List of keys of files/folders, e.g. [{key: "92658E4E-42E9-4A40-B310-E7E1064C7BDA.jpeg", entryType: 1}, {key: "adobe1.png", entryType: 1}]
|
RESPONSE
Field |
Type |
Description |
success |
Boolean |
If successfully get items, then it will return true |
data |
List |
List object contains notes, tags for each item |
key |
String |
Item's path key |
tags |
List |
Item's tags list |
note |
String |
Item's associated notes |
favorite |
Boolean |
Indicates if selected item is marked as favorite or not |
Get File Properties
# Here is a javascript example
function getfileproperties() {
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/getfileinfo?key=168mail.txt', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
}
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Returns the basic file properties (date and size) for a given file and path.
To get file properties, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/common/GetListItemsData
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"key": "168mail.txt",
"displayText": "168mail.txt",
"entryType": 10,
"entryTypeDisplayText": "Text",
"lastModified": "2024-09-20T06:51:17.8374165",
"sizeBytes": 6192,
"size": "6 KB",
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": {
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": null,
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
QUERY PARAMETERS
Field |
Type |
Description |
key |
String |
File key for which you want to get properties e.g. test/abc.txt, gs:2345/abc.txt
|
RESPONSE
Field |
Type |
Description |
key |
String |
Item's path key |
displayText |
String |
File Name |
entryTypeDisplayText |
String |
File's type e.g. text, Microsoft office, PDF |
lastModified |
DateTime |
File's last modified date |
sizeBytes |
Long |
File's size in bytes |
size |
String |
File's size in text e.g. kb, mb, gb |
Convert DOC to PDF
# Here is a javascript example
function doctopdf() {
var item = {
"key" : [ "test/Awspackger1.docx", "test/Awspackger21.docx"],
"destinationKey": "test",
"destinationRemember": false
};
fetch('https://fawapi.filesanywhere.com/api/v1/converter/doctopdf', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization' : 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Convert Document file to PDF file. It might be take some time to convert document file to pdf file, so it will return asyncTaskId in response.
To convert document file to pdf file, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/converter/doctopdf
Result example :
{
"success": true,
"processedAsync": true,
"asyncTaskId": "dfc18736-3ed9-4120-9c4c-54b28dc1d206",
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
QUERY PARAMETERS
Field |
Type |
Description |
Key |
String[] |
Document file list which needs to convert into PDF file.
|
destinationKey |
String |
Destination key, where generated PDF file will be saved.
|
destinationRemember |
Boolean |
It will save destination key as default destination key for next time.
|
RESPONSE
Field |
Type |
Description |
success |
Boolean |
If successfully converted document to pdf file, then it will return true |
Convert Image to PDF
# Here is a javascript example
function imagetopdf() {
var item = {
"key" : [ "adobe1.png", "adobe2.png"],
"destinationKey": "test",
"title": "testTitle",
"sizeType": 0,
"destinationRemember": false
};
fetch('https://fawapi.filesanywhere.com/api/v1/converter/imagetopdf', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization' : 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Convert Images file to PDF file.
To convert image file to pdf file, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/converter/imagetopdf
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"key": "test/checkname.pdf",
"displayText": "checkname.pdf",
"entryType": 8,
"entryTypeDisplayText": null,
"lastModified": null,
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": {
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": true,
"groupSharePermission": 5,
"groupShareBy": "JALPESH215",
"groupShareByUserId": 2,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": null,
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
QUERY PARAMETERS
Field |
Type |
Description |
key |
String[] |
Image file list which needs to convert into PDF file.
|
destinationKey |
String |
Destination key, where generated PDF file will be saved.
|
title |
String |
Newly converted PDF file name, which will be save in destination folder.
|
destinationRemember |
Boolean |
(Optional) It will save destination key as default destination key for next time.
|
sizeType |
Int |
(Optional) The images in PDF page displaying in 5 format types.
0 -> Default, 1 image per row
1 -> 4 images in 2 column
2 -> 4 images in 1 column
3 -> 2 images in 1 column
4 -> custom size (need to pass "HeightInInch", "WidthInInch" int parameters)
|
heightInInch |
Int |
(Optional) User can pass height of an image if SizeType selection is 4 (Custom size)
|
widthInInch |
Int |
(Optional) User can pass width of an image if SizeType selection is 4 (Custom size)
|
RESPONSE
Field |
Type |
Description |
success |
Boolean |
If images are successfully converted into PDF file, then it will return true |
Get fax default
# Here is a javascript example
function faxdefault() {
fetch('https://fawapi.filesanywhere.com/api/v1/fax/getfaxdefaults', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
}
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Use the FaxGetDefaults method to retrieve the values you elected to save from your last fax sent. This makes resending faxes more convienient by retrieving cover page, sender and recipient information.
To get fax default values, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/fax/getfaxdefaults
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"keys": null,
"recipientName": "TEST",
"recipientFaxNumber": "x (xxx) xxx-xxxx",
"recipientAltFaxNumber": null,
"recipientEmail": null,
"recipientCompanyName": null,
"recipientVoicemailNumber": null,
"saveAsDefaultRecipient": true,
"saveSentFax": false,
"senderName": "test215",
"senderFaxNumber": "(xxx) xxx-xxxx",
"senderEmail": "abc@test.com",
"senderCompanyName": null,
"senderVoicemailNumber": null,
"saveAsDefaultSender": true,
"displayCover": true,
"coverTitle": null,
"coverMessage": "test",
"saveAsDefaultCoverPage": true,
"faxCodeNumber": null,
"sensitivityCode": null
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
RESPONSE
Field |
Type |
Description |
saveAsDefaultRecipient |
Boolean |
Returns true or false from last saved fax. Indicates whether (RecipientNames, RecipientFaxNumbers, RecipientCompanyName, RecipientEmailAddresses, RecipientVoiceNumber, RecipientAlternateFaxNumber) should be saved as defaults for your future faxes. |
saveSentFax |
Boolean |
Returns true or false from last saved fax. Indicates whether faxes will be saved in your FilesAnywhere account. |
sensitivityCode |
String |
Sensitivity of the fax (ex: Confidential, Personal) |
recipientName |
String |
Returns “;” delimited list or single name to which the last saved fax was sent.Ex:
John Doe;Joe Blow;Murphys Law
Or
John Doe
|
recipientEmail |
String |
Returns “;” delimited list or single emailaddress to which the last saved fax was sent.Ex:
John.Doe@abc.com;Joe.Blow@abc.com;Murphys.Law@abc.com Or
John.Doe@abc.com
|
recipientFaxNumber |
String |
Returns “;” delimited list or single number to which the last saved fax was sent.Ex:
9725551212;8175551212;2145551212
Or
9725551212
|
recipientVoicemailNumber |
String |
Recipient’s voice phone number.
|
recipientCompanyName |
String |
Name of fax recipient’s company.
|
recipientAltFaxNumber |
String |
Number used if the primary fax number is busy.
|
senderName |
String |
Name used on the fax for “Sent By”.
|
senderEmail |
String |
“Sent By” email address. This address will receive a delivery confirmation.
|
senderFaxNumber |
String |
“Sent By” fax number.
|
senderCompanyName |
String |
“Sent By” company name.
|
saveAsDefaultSender |
Boolean |
Returns true or false from last saved fax. If true following fields will be saved: (SendersName, SendersVoiceNumber, SendersFaxNumber, SendersEmailAddress, SendersCompanyName) as defaults for your future faxes.
|
senderVoicemailNumber |
String |
“Sent By” voice number.
|
displayCover |
Boolean |
Returns true or false from last saved fax. If true then faxes will have a cover page containing the information provided in the following fields: (SendersName, SendersVoiceNumber, SendersFaxNumber, SendersEmailAddress, SendersCompanyName, CoverPageSubject, RecipientCoverSheet, FaxSensitivityCode, FaxReferenceNumber)
|
saveAsDefaultCoverPage |
Boolean |
Returns true or false from last saved fax. If true then the coversheet information will be saved for future faxes sent.
|
coverTitle |
String |
Returns value from last saved fax as cover page title.
|
coverMessage |
String |
Returns value from last saved fax as cover page message.
|
faxCodeNumber |
String |
Returns value from last saved fax as fax reference number.
|
Send Fax
# Here is a javascript example
function sendFax() {
var item = {
"keys" : [ { "key" : "adobe1.png", "EntryType": "0"}, { "key" : "adobe2.png", "EntryType": "0"}],
"recipientName": "usertest",
"recipientFaxNumber": "+18320973156",
"senderName": "user2"
}
fetch('https://fawapi.filesanywhere.com/api/v1/fax/sendfax', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This function sends a fax using the proprietary FilesAnywhere Web Fax Service.
To send fax, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/fax/sendfax
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
keys |
List |
List of keys of files/folders, e.g. [{key: "testfolder/abc.docx", entryType: 1}, {key: "adobe1.png", entryType: 1}] |
recipientName |
String |
Recipient name
|
recipientFaxNumber |
String |
Recipient fax number |
senderName |
String |
Sender (fax sent by) Name |
recipientAltFaxNumber |
String |
(Optional) Recipient alternet fax number |
recipientCompanyName |
String |
(Optional) Recipient company name |
recipientEmail |
String |
(Optional) Recipient email address |
recipientVoicemailNumber |
String |
(Optional) Recipient Voice mail Number |
senderCompanyName |
String |
(Optional) Sender company name |
senderEmail |
String |
(Optional) Sender email address |
senderFaxNumber |
String |
Sender fax number |
senderVoicemailNumber |
String |
(Optional) Sender Voice mail Number |
displayCover |
Boolean |
(Optional) if true then faxes will have a cover page containing the information provided in the following fields: (SendersName,SendersVoiceNumber,SendersFaxNumber,SendersEmailAddress,SendersCompanyName,CoverPageSubject,RecipientCoverSheet, SensitivityCode,FaxCodeNumber) |
coverTitle |
String |
(Optional) Cover page title |
coverMessage |
String |
(Optional) Cover page message |
sensitivityCode |
String |
(Optional) Sensitivity of the fax (ex: Confidential, Personal). |
faxCodeNumber |
String |
(Optional) faxCodeNumber is a field you may want to use for your own tracking. |
faxCodeNumber |
String |
(Optional) faxCodeNumber is a field you may want to use for your own tracking. |
saveSentFax |
Boolean |
(Optional) if true then sent faxes will be saved in your FilesAnywhere account. |
saveAsDefaultCoverPage |
Boolean |
(Optional) if true then the cover page information will be saved for future faxes sent. |
saveAsDefaultRecipient |
Boolean |
(Optional) if true then the following fields will be saved: (RecipientName,RecipientFaxNumbers,RecipientCompanyName,RecipientEmailAddresses,RecipientVoiceNumber,RecipientAlternateFaxNumber) as defaults for your future faxes. |
saveAsDefaultSender |
Boolean |
(Optional) if true then the following fields will be saved: (SendersName,SendersVoiceNumber,SendersFaxNumber,SendersEmailAddress,SendersCompanyName) as defaults for your future faxes. |
RESPONSE
Field |
Type |
Description |
Success |
boolean |
Return true when successfully sent fax. |
Save FileAging Rule
# Here is a javascript example
function saverule() {
var item = {
"folderPathKey" : "test/",
"ruleName": "agingrule1",
"agingStartDate": "03/28/2025",
"retentionDays": 10,
"AgingType": 2,
"FolderOption": 1,
}
fetch('https://fawapi.filesanywhere.com/api/v1/filelifecycle/save', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization':'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Create or Edit FileLifeCycle and FileArchive Rule on a folder.
To create or edit file lifectyle or file archive rule, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/filelifecycle/save
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
folderPathKey |
String |
Folder on which Rule needs to be define. |
ruleName |
String |
Aging rule name
|
agingStartDate |
Date |
Value indicates the date onwards that the rule will start its execution |
retentionDays |
Integer |
Files older than specified days will be Deleted or Archived, value should be >0 and <= 9999 days. |
agingType |
Integer |
Value indicates Aging rule type, value could be 1 (File Archive Rule) or 2 (File Life Cycle) |
folderOption |
Integer |
Value could be 1 (Keep Empty Folders) or 2 (Delete Empty Folders) |
archivePathKey |
String |
FolderPath where file will be archived When Aging type is File Archive Rule. When AgingType is File Life Cycle then value will not consider. |
id |
Integer |
To create new rule Aging ID needs to pass as 0 else for edit operation respective rule Aging ID needs to pass. |
fileMask |
String |
FileName and extension to include in AgingRule e.g. Mark all the files then Pattern would be *.* Specific extension files then pattern would be *.doc
|
notificationAdvDays |
Integer |
(Optional) Value represents how many days before system should send Archival/LifeCycle reminder mail. |
reportToAdditionalEmails |
String |
(Optional) List of email addresses delimited by ; |
emailReportToAllGroupShareUsers |
Boolean |
(Optional) All Groupshare users will get notification when it is set to True.
When it is set to False then only Selected GroupShare user will get notification.
|
reportToGroupShareUsers |
List |
(Optional) List of Groupshare users which will receive the notifications when EmailReportToAllGroupShareUsers is set to False. |
emailReportToFolderOwner |
Boolean |
(Optional) Flag indicates that owner of folder will receive the notifications of Aging rule execution or not. |
disabled |
Boolean |
(Optional) Flag indicating that Rule is enabled or not. |
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when successfully update file aging or file archive rule. |
Delete FileAging Rules
# Here is a javascript example
function deleterule() {
var item = {
"ruleids" : [100,333]
}
fetch('https://fawapi.filesanywhere.com/api/v1/filelifecycle/delete', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Removes File LifeCyle or Archive rules.
To delete file lifectyle or file archive rules, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/filelifecycle/delete
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
ruleIds |
List[Integer] |
List of AgingID needs to supply which needs to be deleted. |
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when successfully update file aging or file archive rule. |
Add GroupShare
# Here is a javascript example
function addGshare() {
var item = {
"sharedTo": [ { "SharedTo" : "clonep1", "IsSharedToGroup": false}],
"key" : "test/",
"shareNote": "Groupshare update",
"permission": 1,
"expirationTime": 1,
"notifyUser": true,
"customExpirationTime" : "2025-04-15 10:23 PM"
}
fetch('https://fawapi.filesanywhere.com/api/v1/groupshare/insertorupdate', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This function allows the user to share folder under its account or entire account with other existing FilesAnywhere users.
To add groupshare in user's account, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/groupshare/insertorupdate
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"key": "test/",
"displayLocation": "\\test215\\test\\",
"groupShareDetails": [
{
"sharedToUserName": "testuser",
"isSharedToGroup": false,
"permission": 1,
"permissionText": "Preview Only",
"sharedOn": "2025-03-31T11:21:32.003",
"expiredOn": "2025-04-01T00:51:31.983",
"shareNote": null
}
],
"parentGroupShared": false,
"parentDisplayLocation": null,
"parentKey": null,
"readOnlyMode": false,
"ownerUserName": null,
"accountName": null,
"ownerEmail": null
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
sharedTo |
List |
List of sharedTo users, e.g. [{"SharedTo": "testuser1", "IsSharedToGroup": false, "SharedToGroupName": ""}, {{"SharedTo": "grouptest1", "IsSharedToGroup": true}}] |
key |
String |
User’s personal folder path that the user wants to share with the FilesAnywhere existing user specified in the sharedTo field.
|
permission |
Integer |
Permission flag set for the SharedFolder. Following are the access levels that can be set for the shared folder
ReadOnly = 0,
PreviewOnly = 1,
UploadOnly = 2,
CreateOrUpdate = 3,
MasterAccess = 4,
FullAccess = 5
|
expirationTime |
Integer |
GroupShare Expiration Time. Following are the expiration time options that can be set for the shared folder
Custom = 1,
Hours24 = 2,
Hours48 = 3,
Days5 = 5,
Days10 = 10,
Days15 = 15,
Days30 = 30,
Days60 = 60,
Days90 = 90,
Days180 = 180,
Year1 = 11,
Never = 12
|
(optional) shareNote |
String |
Note is the text that the user wants to attach to the new Group Share folder for future reference
|
(optional) customExpirationTime |
DateTime |
If ExpirationTime is set as 1 (Custom), then this field will be used to set the custom expiration time e.g "2025-04-15 10:23 PM"
|
RESPONSE
Field |
Type |
Description |
success |
boolean |
Return true when successfully created groupshare. |
Add/Edit Item description/notes
# Here is a javascript example
function addDescription() {
var item = {
"key" : "1_Readonly.ppt",
"description": "Description update",
"itemType": 1
}
fetch('https://fawapi.filesanywhere.com/api/v1/FolderComment/createorupdate', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This method add/edit description/notes of a file or folder.
To add/edit item's description, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/FolderComment/createorupdate
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"key": "1_Readonly.ppt",
"description": "decsription updated",
"isListViewNoteEnabled": true
},
"message": null
}
Add/Edit Folder properties
# Here is a javascript example
function updateProperties() {
var item = {
"key" : $("#dest").val(),
"fileCheckinNotification": true,
"fileCheckoutNotification": true,
"alwaysSendEmailToAllUsers": true,
"fileUpload": true,
"isVersionHistoryEnabled": true,
"isCheckoutEnabled": true,
"dailyEmail": true,
"isSendMailToOwner": true,
"isSendMailToGroupShareUser": true,
"isDeleteDisabled": true,
"commentNotification": true,
"deleteNotification": true,
"moveNotification": true,
"copyNotification": true,
"renameNotification": true,
"createNotification": true,
"emails": "test@faw.com",
"versionKeep": 1 ,
"operationTypeOnSubFolder": 1
}
fetch('https://fawapi.filesanywhere.com/api/v1/FolderProperties/createorupdate', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId': 2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Sets folder properties such as file version history and check-in/check-out and enable the notifications on various operations on folder.
To add/edit folder's properties, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/FolderProperties/createorupdate
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
key |
String |
Folder path that the user wants to add/edit folder properties.
|
isVersionHistoryEnabled |
Boolean |
Flag indicating the folder has version history control enabled.
|
isCheckoutEnabled |
Boolean |
Flag indicating the folder has check-in/checkout enabled.
|
isDeleteDisabled |
Boolean |
Flag indicating if delete is disabled for the folder.
|
fileCheckinNotification |
Boolean |
Flag indicating that Notification email sent when File will be Uploaded or Checked-in.
|
fileCheckoutNotification |
Boolean |
Flag indicating that Notification email sent when File will be Checkout
|
alwaysSendEmailToAllUsers |
Boolean |
Flag indicating notification goes to all users (OwnerUser/GroupShareUseractivity).
|
isSendMailToOwner |
Boolean |
Flag indicating that folder owner user should receive the notifications applied on folder.
|
isSendMailToGroupShareUser |
Boolean |
Flag indicating that Groupshare users of folder should receive the notifications applied on folder.
|
dailyEmail |
Boolean |
Flag indicating if a daily email of activity is sent.
|
fileUpload |
Boolean |
Flag indicating that Notification email sent when File will be Uploaded or Checked-in.
|
commentNotification |
Boolean |
User will get notification when a new comment will be added to file/folder
|
deleteNotification |
Boolean |
User will get notification when a folder/file will be deleted
|
moveNotification |
Boolean |
User will get notification when a folder/file will be moved
|
copyNotification |
Boolean |
User will get notification when a folder/file will be copied
|
renameNotification |
Boolean |
User will get notification when a folder/file will be renamed
|
createNotification |
Boolean |
User will get notification when a folder will be created
|
versionKeep |
Integer |
Represent the number of Version wants to keep when IsVersionHistoryEnabled enabled on folder.
|
emails |
String |
Additional email addresses delimited by ; on which you would like to receive the notifications.
|
operationTypeOnSubFolder |
Integer |
1 -> Properties will be override for sub folders
2 -> Properties will be detached for sub folders
|
RESPONSE
Field |
Type |
Description |
Success |
boolean |
Return true when successfully updated comment. |
Create FileShare link
# Here is a javascript example
function createFSLink() {
var item = {
"keys" : [ { "key" : "test/Awspackger1.png", "EntryType": "0"}, { "key" : "test/Awspackger21.png", "EntryType": "0"}],
"linkType": 2,
"emailTo": "abc@test.com" ,
"passwordSecurityType": 1,
"password": "xxxxxx",
"saveToContact": true,
"enableCoverPage": true,
"coverPageTitle": "test coverpage title",
"coverPageMessage": "cover page message",
"checkBoxApprovalText": "please approve",
"TermsApproval" : "I Agree", //Checkbox text for terms and conditions
"inputPromptMessage": "Name",
"InputPromptMessage2" : "Position", //Input text box to enter user's name
"InputPromptMessage3" : "Company", //Input text box to enter user's name
"InputPromptMessage4" : "Company Address", //Input text box to enter user's name
"InputPromptEmailAddress": "Enter your email address",
"signaturePrompt": "sign here",
"flagLog": true,
"id": 0,
"fileSharedays": 10,
"flagWaterMark": false,
"includeWatermarkEmailId": false,
"includeWatermarkFileShareId": false,
"includeWatermarkIp": false,
"includeWatermarkTimeStamp": false,
"waterMarkCenter": "",
"waterMarkBottom": "",
"watermarkColor": "",
"watermarkSize": 0,
"redirectUrl":"",
"flagReadReceipt": false, //islinkaccessemail
"isPhoto": 1, //iconview, detailview, preview
"flagEmail": false,
"downloadLimit": 1,
"flagViewOnly": 0, //download, view only
"hideName": false,
"hideEmail": false,
"hideComment": false,
"rememberChoices": false,
"doNotSendFileShareMail": false,
"comments": "",
"emailFrom": "", //support email or user email
"subject": "",
}
fetch('https://fawapi.filesanywhere.com/api/v1/FileShare/create', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Shares files and folders securely with anyone, even non-members, using a web URL link. An email is sent by the system containing an encrypted web link, which when clicked by the recipient, will prompt them to download the shared files and folders, or view them online, according to the parameters (options) given when calling the function.
If the 'RecipientEmails' parameter is equal to the value 'GENERALLINK', the function will return the FileShare URL Link without sending an email.
This link can be used directly from any location, and the link behaves exactly like the way it does when sent in an email.
To create fileshare link , you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/FileShare/create
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"linkType": 0,
"items": [
{
"email": "GENERALLINK (41627)",
"url": "https://private.filesanywhere.com/guest/fs?v=8c6a68885f94adbba5a0&C=215",
"relativeUrl": "guest/fs?v=8c6a68885f94adbba5a0&C=215"
}
],
"keys": [
{
"key": "test/Awspackger1.png",
"entryType": 1
},
{
"key": "test/Awspackger21.png",
"entryType": 1
}
],
"linkViewMode": 1
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
keys |
List |
Item keys to create file share link
|
emailTo |
String |
Semi-colon-separated list of email addresses to send the FileShare link to.
|
linkType |
Integer |
Link Type. Following are the link type options that can be set for FileShare link
GeneralLink = 0,
Outlook = 1,
Email = 2
|
passwordSecurityType |
Integer |
Password security Type. Following are the password security type options that can be set for FileShare link
None = 0, (unprotected file share link will be created)
Password = 1, (file share link will be protected by password)
OtpEmail = 2, (means file share link will be protected by OTP email)
OtpSMS = 3, (file share link will be protected by OTP SMS)
|
password |
String |
If PasswordSecurityType is set as 1 (Password), then password text should be pass in this parameter.
|
saveToContact |
Boolean |
Email addressed passed in 'emailTo' field, will be saved in contacts list of this user.
|
enableCoverPage |
Boolean |
Flag indicating the FileShare has a cover page or not.
|
isPhoto |
Integer |
(Optional) Flag options for the default view of the FileShare, e.g. 0 for Icon view, 1 for Detail view and 2 for Preview.
|
fileSharedays |
Integer |
(Optional) The number of days the FileShare link will remain active.
|
flagLog |
Boolean |
(Optional) Flag indicating to log activity.
|
flagEmail |
Boolean |
(Optional) Flag indicating to send email notification to recipients.
|
flagReadReceipt |
Boolean |
(Optional) Flag indicating a read receipt should be generated for the email notification when it is read.
|
flagReadReceipt |
Boolean |
(Optional) Flag indicating a read receipt should be generated for the email notification when it is read.
|
flagViewOnly |
Integer |
(Optional) Flag indicating whether the file share allows downloads or is view-only, e.g 0 for download and 1 for view-only.
|
downloadLimit |
Integer |
(Optional) Maximum number of downloads for the FileShare.
|
flagWaterMark |
Boolean |
(Optional) Flag indicating to display a watermark.
|
waterMarkCenter |
String |
(Optional) Text displayed in center watermark.
|
waterMarkBottom |
String |
(Optional) Text displayed in bottom watermark.
|
emailFrom |
String |
(Optional) Flag indicating the email notification should be sent from the system email account or the user’s email account.
|
subject |
String |
(Optional) Email subject in the notification.
|
comments |
String |
(Optional) Email body in the notification.
|
enableCoverPage |
Boolean |
(Optional) Flag indicating the FileShare link has a cover page.
|
coverPageTitle |
String |
(Optional) Title text for the cover page.
|
coverPageMessage |
String |
(Optional) Message text for the cover page.
|
TermsApproval |
String |
(Optional) Text displayed to obtain terms from the user.
|
checkBoxApprovalText |
String |
(Optional) Text displayed to obtain approval from the user.
|
inputPromptMessage |
String |
(Optional) Text displayed to obtain input from the user, e.g. 'Enter your name'.
|
InputPromptMessage2 |
String |
(Optional) Text displayed to obtain input from the user, e.g. 'Enter your position'.
|
InputPromptMessage3 |
String |
(Optional) Text displayed to obtain input from the user, e.g. 'Enter your company'.
|
InputPromptMessage4 |
String |
(Optional) Text displayed to obtain input from the user, e.g. 'Enter your company address'.
|
InputPromptEmailAddress |
String |
(Optional) Text displayed to obtain email address from the user. e.g. 'Enter your email address'.
|
signaturePrompt |
String |
(Optional) Text displayed to obtain a signature from the user.
|
hideName |
Boolean |
(Optional) Flag indicating to display the user’s name.
|
hideEmail |
Boolean |
(Optional) Flag indicating to display the user’s email address.
|
hideComment |
Boolean |
(Optional) Flag indicating to display the comments
|
includeWatermarkEmailId |
Boolean |
(Optional) Flag indicating to include recipient’s email address into watermark text.
|
includeWatermarkFileShareId |
Boolean |
(Optional) Flag indicating to include FileShare ID into watermark text.
|
includeWatermarkIp |
Boolean |
(Optional) Flag indicating to include IP address into watermark text
|
includeWatermarkTimeStamp |
Boolean |
(Optional) Flag indicating to include downloaded item’s date time stamp into watermark text
|
watermarkSize |
Integer |
(Optional) Size of watermark text in pixels, possible values are {8, 10, 12, 14, 16, 18, 20, 22, 24}. Default value will be 8.
|
watermarkColor |
Integer |
(Optional) Color of watermark text. Possible values are RD for Red, GN for Green, GY for Grey, WE for White, BE for Blue, BK for Black
|
RESPONSE
Field |
Type |
Description |
linkType |
String |
FileShare link type either it can be 0 - GeneralLink, 1 - Outlook or 2 - Email |
email |
String |
Created FileShare link type with FileShare Id in bracket e.g GENERALLINK (41627) or abc@test.com (41627) |
url |
String |
Created FileShare link URL |
relativeUrl |
String |
Created FileShare link's relative URL |
Get FileShare defaults
# Here is a javascript example
function getfilersharedefaults() {
fetch('https://fawapi.filesanywhere.com/api/v1/user/getfilesharesettings', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This method returns the preferred FileShare Link settings.
To get FileShare default settings, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/user/getfilesharesettings
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"fileShareAttachmentFlag": null,
"fileShareFlagViewOnly": null,
"fileShareDownloadLimit": 0,
"fileShareFlagWaterMark": false,
"fileShareFlagMediaView": 1,
"fileShareFlagLog": true,
"fileShareFlagEmail": true,
"fileShareFlagReadReceipt": true,
"fileShareWaterMarkCenter": null,
"fileShareWaterMarkBottom": null,
"fileSharedays": 30,
"fileShareFlagEmailFromSystem": true,
"fileShareEmailSubject": null,
"fileShareEmailBody": null,
"fileShareCPFlag": true,
"fileShareCheckBoxApprovalText": "I Agree",
"fileShareInputPromptMessage": "Enter your name",
"fileShareSignaturePrompt": "Sign Here",
"fileShareRedirecturl": null,
"fileShareLanguage": "en-US",
"fileShareAllowGuestComments": true,
"fileShareSaveContacts": true,
"fileShareHideEmail": false,
"fileShareHideName": true,
"fileShareHideComment": true,
"fileShareIncludeWMEmailId": false,
"fileShareIncludeWMFSId": false,
"fileShareIncludeWMIP": false,
"fileShareIncludeWMTimeStamp": false,
"fileShareWMSize": 10,
"fileShareWMColor": "GY",
"isRestoreSettings": false,
"fileShareLinkPassword": null,
"fileShareLinkExpireDays": 30,
"fileShareLinkDdlPositions": null,
"password": null,
"expireAfterDays":
[
{
"disabled": false,
"group": null,
"selected": false,
"text": "24 hours from now",
"value": "1"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "48 hours from now",
"value": "2"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "5 days from now",
"value": "5"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "10 days from now",
"value": "10"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "15 days from now",
"value": "15"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "30 days from now",
"value": "30"
}
],
"downloadLimit": [
{
"disabled": false,
"group": null,
"selected": false,
"text": "Unlimited",
"value": "0"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "1",
"value": "1"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "2",
"value": "2"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "3",
"value": "3"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "4",
"value": "4"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "5",
"value": "5"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "6",
"value": "6"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "7",
"value": "7"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "8",
"value": "8"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "9",
"value": "9"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "10",
"value": "10"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "11",
"value": "11"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "12",
"value": "12"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "13",
"value": "13"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "14",
"value": "14"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "15",
"value": "15"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "16",
"value": "16"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "17",
"value": "17"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "18",
"value": "18"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "19",
"value": "19"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "20",
"value": "20"
}
],
"watermarkPositions": [
{
"disabled": false,
"group": null,
"selected": false,
"text": "Footer",
"value": "F"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "Center",
"value": "C"
}
],
"watermarkSize":
[
{
"disabled": false,
"group": null,
"selected": false,
"text": "8px",
"value": "8"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "10px",
"value": "10"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "12px",
"value": "12"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "14px",
"value": "14"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "16px",
"value": "16"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "18px",
"value": "18"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "20px",
"value": "20"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "22px",
"value": "22"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "24px",
"value": "24"
}
],
"watermarkColor": [
{
"disabled": false,
"group": null,
"selected": false,
"text": "Grey",
"value": "GY"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "White",
"value": "WE"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "Red",
"value": "RD"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "Green",
"value": "GN"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "Blue",
"value": "BE"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "Black",
"value": "BK"
}
],
"avilableEmailFrom":
[
{
"disabled": false,
"group": null,
"selected": false,
"text": "abc@test.com",
"value": "abc@test.com"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "support@filesanywhere.com",
"value": "support@filesanywhere.com"
}
],
"enableWatermark": null,
"watermarkText": null,
"emailFrom": "support@filesanywhere.com",
"enableCoverPage": null,
"fileShareCPTitle": "boldttext",
"fileShareCPMessage": "",
"checkboxApproval": true,
"verificationText": true,
"signature": true,
"settingsFlagLogDisabled": false,
"sampleWatermarkText": "jalpesh@filesanywhere.com",
"watermarkTextDB": null,
"merged": "boldttextboldttextI AgreeEnter your nameEnter your nameSign Here",
"inputPromptMessage2": null,
"inputPromptEmailAddress": null,
"inputPromptMessage3": null,
"inputPromptMessage4": null,
"termsApproval": null,
"enableTermsApproval": false,
"enableInputPromptMessage2": false,
"enableInputPromptMessage3": false,
"enableInputPromptMessage4": false,
"enableInputPromptEmailAddress": false,
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
RESPONSE
Field |
Type |
Description |
fileSharedays/fileShareLinkExpireDays |
Integer |
Number of days the recipient can access the FileShare Link. |
fileShareFlagViewOnly |
Boolean |
Flag indicates that the recipient can only view the items shared by the user. A “False” allows the recipient to download files too. |
fileShareDownloadLimit |
Integer |
The limit on the number of downloads for each item by the recipients. A 0 indicates unlimited download. |
fileShareFlagWaterMark |
Boolean |
A “True” indicates that the watermark text specified by the user appears on the images and the documents that is viewed in the online viewer. |
fileShareFlagMediaView |
Integer |
A “0” or “1” or “2” Flag indicating the way in which the items will be displayed.
0 - Icon View: The recipients will be able to see the items as thumbnails list
1 - Detail View: items will be displayed in rows with comments and search.
2 – PreView: The recipients will be able to see the items as thumbnails, slideshow, streaming media
|
fileShareFlagLog |
Boolean |
Flag indicating whether each file download should be recorded in the File History Log. |
fileShareFlagEmail |
Boolean |
Flag indicating whether the FileShare owner should be notified by email about each file downloaded. |
fileShareFlagReadReceipt |
Boolean |
Flag indicating whether the FileShare owner is notified when the recipient clicks on the FileShare link. |
fileShareWaterMarkCenter |
String |
Watermark text that appears at the center of the item viewed in the online viewer. |
fileShareWaterMarkBottom |
String |
Watermark text that appears at the bottom of the item viewed in the online viewer. |
fileShareFlagEmailFromSystem |
Boolean |
Flag indicating whether the email containing the FileShare link should have its “Sent From” email address as the FilesAnywhere System email address (indicated by a “true”) or the FileShare owners email address (indicated by a “false”). |
fileShareEmailSubject |
String |
Text that appears in the email subject. |
fileShareEmailBody |
String |
Message that appears in the email body. |
fileShareCPFlag |
Boolean |
Flag indicating enable cover page |
fileShareCheckBoxApprovalText |
String |
FileShare checkbox approval text |
fileShareInputPromptMessage |
String |
FileShare input prompt message |
inputPromptMessage2 |
String |
FileShare input prompt message |
inputPromptMessage3 |
String |
FileShare input prompt message |
inputPromptMessage4 |
String |
FileShare input prompt message |
inputPromptMessage4 |
String |
FileShare input prompt message |
inputPromptEmailAddress |
String |
FileShare input prompt email address |
fileShareSignaturePrompt |
String |
FileShare signature prompt text |
enableTermsApproval |
Boolean |
Enable terms approval |
enableInputPromptMessage2 |
Boolean |
Enable InputPromptMessage2 |
enableInputPromptMessage3 |
Boolean |
Enable InputPromptMessage3 |
enableInputPromptMessage4 |
Boolean |
Enable InputPromptMessage4 |
enableInputPromptEmailAddress |
Boolean |
Enable Input for Email Address |
fileShareSaveContacts |
Boolean |
Save email addresses in contacts to whome FileShare link is sent |
fileShareHideEmail |
Boolean |
Hide email from FileShare link |
fileShareHideName |
Boolean |
Hide name from FileShare link |
fileShareHideComment |
Boolean |
Hide comment from FileShare link |
fileShareIncludeWMEmailId |
Boolean |
Include email id in watermark |
fileShareIncludeWMFSId |
Boolean |
Include FileShare id in watermark |
fileShareIncludeWMIP |
Boolean |
Include IP address in watermark |
fileShareIncludeWMTimeStamp |
Boolean |
Include timestamp in watermark |
fileShareWMSize |
Integer |
Watermark size |
fileShareWMColor |
String |
Watermark color
GY - Grey; WE - White; RD - Red; GN - Green; BE - Blue; BK - Black
|
Create FileShare link with defaults
# Here is a javascript example
function sendFSLinkDefault() {
var item = {
"keys" : [ { "key" : "test/Awspackger1.png", "EntryType": "0"}, { "key" : "test/Awspackger21.png", "EntryType": "0"}],
"linkType" : 0,
"emailTo": "",
"passwordSecurityType": 0,
"password": "",
"saveToContact": true
}
fetch('https://fawapi.filesanywhere.com/api/v1/FileShare/sendfilesharelink', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
});
})
.catch(error => {
// Handle any errors here
});
}
This function is similar to the SendFileShareLink operation, except that it uses the defaults stored in the user profile. It shares items securely with anyone, even non-members, using a web URL link. An email is sent with an encrypted web link, prompting the guest recipients to download the shared items as specified using this function.
To create fileshare link with defaults, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/FileShare/sendfilesharelink
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"linkType": 0,
"items": [
{
"email": "GENERALLINK (41627)",
"url": "http://private.filesanywhere.com/guest/fs?v=8c6a68885f94adbba5a0&C=215",
"relativeUrl": "guest/fs?v=8c6a68885f94adbba5a0&C=215"
}
],
"keys": [
{
"key": "test/Awspackger1.png",
"entryType": 1
},
{
"key": "test/Awspackger21.png",
"entryType": 1
}
],
"linkViewMode": 1
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
keys |
List |
Item keys to create file share link
|
emailTo |
String |
Email Addresses of the recipients
|
linkType |
Integer |
Link Type. Following are the link type options that can be set for FileShare link
GeneralLink = 0,
Outlook = 1,
Email = 2
|
passwordSecurityType |
Integer |
Password security Type. Following are the password security type options that can be set for FileShare link
None = 0,
Password = 1,
OtpEmail = 2,
OtpSMS = 3,
UserDefined = 4,
|
password |
String |
If PasswordSecurityType is set as 1 (Password), then password text should be pass in this parameter.
|
saveToContact |
Boolean |
Email addressed passed in 'emailTo' field, will be saved in contacts list of this user.
|
RESPONSE
Field |
Type |
Description |
linkType |
String |
FileShare link type either it can be 0 - GeneralLink, 1 - Outlook or 2 - Email |
email |
String |
Created FileShare link type with FileShare Id in bracket e.g GENERALLINK (41627) or abc@test.com (41627) |
url |
String |
Created FileShare link URL |
relativeUrl |
String |
Created FileShare link's relative URL |
Get item list of FileShare
# Here is a javascript example
function getProviderEntries() {
fetch('https://fawapi.filesanywhere.com/api/v1/GuestLink?Path=/&Page=1&EntryType=1&SortColumn=Type&SortOrder=0', {
method: 'GET',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-userid': 2,
'Authorization': 'bearer eyJhbGciOiJIU...' //auth token will be acquire from guestlink/login api
}
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
console.log(JSON.stringify(result.data));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Get sub folder/file list of selected path. Each item in this list associated with a unique key and entry type which will be used in other API calls e.g download file
To get file/folder list of FileShare link, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/GuestLink
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"exploreObjects": [
{
"key": "7869381c-7f94-4882-ac65-1a784177a24d",
"displayText": "Awspackger1.png",
"entryType": 0,
"entryTypeDisplayText": "File folder",
"lastModified": null,
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": null,
"parentKey": null,
"displayLocation": null,
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
{
"key": "e3a28dad-7680-4a8b-a705-9e38b1d554dc",
"displayText": "Awspackger21.png",
"entryType": 0,
"entryTypeDisplayText": "File folder",
"lastModified": null,
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": null,
"parentKey": null,
"displayLocation": null,
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
}
],
"hasMorePages": false,
"storageProviderType": 0,
"providerSupportsCopy": false,
"providerSupportsMove": false,
"providerSupportsRename": false,
"providerSupportsDelete": false,
"providerSupportsShare": false,
"providerSupportsDownload": true,
"providerSupportsPreview": true,
"providerSupportsSnapshots": false,
"breadcrumb": {
"links": [
{
"text": "",
"id": 0,
"key": "/",
"active": true
}
]
},
"key": null,
"displayLocation": null,
"continuationToken": null,
"nextContinuationToken": null,
"current": null,
"page": 0,
"count": 0,
"totalResults": 0,
"pageTokens": null,
"isSearchResult": false,
"includeFiles": false,
"allowMultiSelect": false,
"allowFolderSelect": false,
"restrictToPermissions": null
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
FileShare link authentication bearer token, e.g. bearer ___ (Token can be acquired from the Get FileShare link Header Information) |
X-UserId |
Integer |
User’s id (can be acquired from the Get FileShare link Header Information) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
QUERY PARAMETERS
Field |
Type |
Description |
path |
String |
Path to get sub folder/file list, e.g / => root of fileshare, filesharekey/ => get sub items of fileshare folder e.g 3f388d80-c6cf-48c7-bd8f-434e4c45f201/uploadtest => get sub items of group shared folder
|
page |
Integer |
(Optional - default : 1) Page number |
entryType |
Integer |
(Optional - default : 0 for folder, 1 for file) |
sortColumn |
String |
(Optional - default : "Name"), list items sorting by given value, e.g. Name, Type, Size, Date |
sortOrder |
String |
(Optional - default : "asc"), list items sorting order by given value, e.g. asc, desc |
Download file from FileShare
# Here is a javascript example
# Add a reference to jQuery, e.g., https://code.jquery.com/jquery-3.7.1.min.js
function fsdownload() {
var item = {
"keys": [ {"Key":"3f388d80-c6cf-48c7-bd8f-434e4c45f201/ans4 Ren.jpeg", "EntryType": 1} ],
"isDownloadMode": true
}
fetch('https://fawapi.filesanywhere.com/api/v1/guestlink/files/download-multiple', {
method: 'POST',
headers: {
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId': 2,
'Authorization': 'bearer eyJhbGciOiJIU...' //Token can be acquired from the "Get FileShare link Header Information" api
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
downloadFile(result.data[0]);
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
console.log(error); // Example: Logging the error to the console
});
}
function downloadFile(fetchResult) {
var filename = fetchResult.key;
var downloadUrl = fetchResult.url;
const tempLink = document.createElement('a');
tempLink.style.display = 'none';
tempLink.href = downloadUrl;
tempLink.setAttribute('download', filename);
document.body.appendChild(tempLink);
tempLink.click();
document.body.removeChild(tempLink);
}
Download file from FileShare link. This will return a download URL from where you can download the file.
To get download URL of a file from FileShare link, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/guestlink/files/download-multiple
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": [
{
"key": "ans4 Ren.jpeg",
"url": "https://fawapi.filesanywhere.com/api/v1/hostedstorage/215/2?path=31oct12%2fans4+Ren.jpeg&exp=638805666836233352&uploadAction=6&uid=9d56dc28-a84b-4954-a389-9723219b4ede&accesskey=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A&sig=4a21e1b73f9d1f2a8c0a0647db718e4c77ae3a0dbadda0e391b06b1ed7f74328",
"body": null,
"browserDownloadsAllowed": false,
"expirationDateUtc": null,
"headers": {
"fas-date": "20250418T081123Z",
"host": "localhost:7178",
"sig": "4a21e1b73f9d1f2a8c0a0647db718e4c77ae3a0dbadda0e391b06b1ed7f74328",
"authorization": "AWS4-HMAC-SHA256 Credential=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A/20250418/us-east-1/fas/aws4_request, SignedHeaders=fas-date;host, Signature=4a21e1b73f9d1f2a8c0a0647db718e4c77ae3a0dbadda0e391b06b1ed7f74328"
},
"chunked": false,
"chunkUrls": null,
"totalChunks": 0,
"explorerObject": {
"key": null,
"displayText": null,
"entryType": 11,
"entryTypeDisplayText": null,
"lastModified": null,
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": null,
"parentKey": null,
"displayLocation": null,
"displayKey": "ans4 Ren.jpeg",
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"lastModified": null
}
],
"message": null
}
REQUEST HEADERS
BDOY PARAMETERS
Field |
Type |
Description |
keys |
List |
File list which needs to download, e.g. [{"Key":"3f388d80-c6cf-48c7-bd8f-434e4c45f201/ans4 Ren.jpeg", "EntryType": 1}]
|
isDownloadMode |
Boolean |
True for download file, false means its in preview mode |
RESPONSE
Field |
Type |
Description |
data |
List |
List of files contains in given folder of FileShare link |
data[0].url |
String |
Download url for a file |
data[0].key |
String |
File name |
Create FileReceive link
# Here is a javascript example
function createFRLink() {
var item = {
"key" : "apitest1",
"linkType": 2,
"emailTo": "abc@test.com" ,
"redirectUrl":"",
"redirectText":"",
"smailRecipients":"",
"sharedays": 10,
"subject":"Test",
"password": "*******",
"isLog": true,
"emailMeNotification": false,
"isOverwrite": true,
"subFolderText": "test folder title",
"linkAccessEmailMe": false,
"isHideEmail": false,
"isHideName": false,
"isUploadFolder": true ,
"comments": "",
"emailFrom": "",
"saveToContact": true,
"rememberChoices":true
}
fetch('https://fawapi.filesanywhere.com/api/v1/FileReceive/create', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Use this method to share a FileReceive URL link securely with anyone by sending encrypted web link in an email.
To create FileReceive link , you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/FileReceive/create
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"items": [
{
"email": "abc@faw.com (13151)",
"url": "http://private.filesanywhere.com/guest/fr?v=896c638b599eaaa9ada1&C=215",
"relativeUrl": "guest/fr?v=896c638b599eaaa9ada1&C=215"
}
],
"linkViewMode": 2
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
key |
String |
Folder key where files/folders will be uploaded through FileReceive link.
|
emailTo |
String |
Semi-colon-separated list of email addresses to send the FileReceive link to.
|
linkType |
Integer |
Link Type. Following are the link type options that can be set for FileReceive link
GeneralLink = 0,
Outlook = 1,
Email = 2
|
sharedays |
Integer |
The number of days the FileReceive link will remain active.
|
password |
String |
(Optional) It’s the password that the recipient is required to enter to view the items. The password is not emailed to the recipient and the user has to inform them directly.
|
saveToContact |
Boolean |
(Optional) Email addressed passed in 'emailTo' field, will be saved in contacts list of this user.
|
isLog |
Boolean |
(Optional) Flag indicating to log activity.
|
emailMeNotification |
Boolean |
(Optional) User is notified by email for each item uploaded.
|
isOverwrite |
Boolean |
(Optional) If this flag is set as true then the file drop will overwrite a file of the same name.
|
subFolderText |
String |
(Optional) The name of the subfolder which gets created when the user makes a file drop. The file gets saved to this subfolder.
|
emailFrom |
String |
(Optional) Flag indicating the email notification should be sent from the system email account or the user’s email account.
|
subject |
String |
(Optional) Text that appears in the email subject.
|
comments |
String |
(Optional) Email body in the notification.
|
isHideName |
Boolean |
(Optional) Flag indicating to display the user’s name.
|
isHideEmail |
Boolean |
(Optional) Flag indicating to display the user’s email address.
|
hideComment |
Boolean |
(Optional) Flag indicating to display the comments
|
isUploadFolder |
Boolean |
(Optional) Flag indicating to allow upload folders in FileReceive link.
|
rememberChoices |
Boolean |
(Optional) Flag indicating to save default settings for FileReceive link to use same setting while creating next FileReceive link.
|
RESPONSE
Field |
Type |
Description |
linkType |
String |
FileShare link type either it can be 0 - GeneralLink, 1 - Outlook or 2 - Email |
email |
String |
Created FileShare link type with FileShare Id in bracket e.g GENERALLINK (41627) or abc@test.com (41627) |
url |
String |
Created FileShare link URL |
relativeUrl |
String |
Created FileShare link's relative URL |
Get FileReceive defaults
# Here is a javascript example
function getfilereceivedefaults() {
fetch('https://fawapi.filesanywhere.com/api/v1/user/getfilereceivesettings', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result));
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This method returns the preferred FileReceive Link settings.
To get FileReceive default settings, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/user/getfilereceivesettings
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"avilableShareDays": [
{
"disabled": false,
"group": null,
"selected": false,
"text": "24 hours from now",
"value": "1"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "48 hours from now",
"value": "2"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "5 days from now",
"value": "5"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "10 days from now",
"value": "10"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "15 days from now",
"value": "15"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "30 days from now",
"value": "30"
}
],
"fileReceiveShareDays": 30,
"expireDays": 30,
"fileReceiveFlagLog": true,
"fileReceiveFlagOverWrite": false,
"fileReceiveAllowUploadFolder": true,
"fileReceiveFlagEmail": true,
"fileReceiveFlagEmailFromSystem": false,
"fileReceiveFlagReadReceipt": true,
"fileReceiveHideEmail": false,
"fileReceiveHideName": false,
"fileReceiveSaveContacts": false,
"userName": "JALPESH215",
"fileReceiveSubFolderText": "Please Enter Your Name",
"fileReceiveEmailSubject": "New FileReceive Link for You at NSDL",
"fileReceiveEmailBody": null,
"redirectUrl": null,
"redirectText": null,
"fileReceiveLanguage": null,
"isResetSettings": null,
"isFileReceiveSubFolderFlag": true,
"dbRecipientsTracking": null,
"displayReturnCustomUrl": false
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
RESPONSE
Field |
Type |
Description |
fileReceiveShareDays/ExpireDays |
Integer |
Number of days the recipient can access the FileReceive Link. |
fileReceiveFlagLog |
Boolean |
Flag indicating whether each file uploaded should be recorded in the File History Log. |
fileReceiveFlagEmail |
Boolean |
Flag indicating whether the FileReceive Link owner should be notified by email about each file drop. |
fileReceiveFlagEmailFromSystem |
Boolean |
Flag indicating whether the email containing the FileReceive Link should have its “Sent From” email address as the FilesAnywhere System email address (indicated by true) or the FileReceive Link owners email address (indicated by false). |
fileReceiveEmailSubject |
String |
Text that appears in the email subject. |
fileReceiveEmailBody |
String |
Message that appears in the email body. |
fileReceiveFlagReadReceipt |
Boolean |
Flag indicating whether the FileReceive Link owner is notified when the recipient clicks on the FileReceive Link. |
fileReceiveFlagOverWrite |
Boolean |
Flag indicating whether file upload can overwrite files of the same name. |
fileReceiveSubFolderText |
String |
The name of the folder which will be created for the file drops. |
fileReceiveAllowUploadFolder |
Boolean |
Flag indicating FileReceive link allowing to upload folder |
fileReceiveHideEmail |
Boolean |
Flag indicating hide email address of owner from FileReceive link |
fileReceiveHideName |
Boolean |
Flag indicating hide name of owner from FileReceive link |
fileReceiveSaveContacts |
Boolean |
Flag indicating save email address in contacts when FileReceive link sent to selected email addresses. |
userName |
String |
FileReceive link owner username |
redirectUrl |
String |
Redirect FileReceive users to mentioned URL |
redirectText |
String |
Text displayed to redirect the users to a URL. |
Download File
# Here is a javascript example
# Add a reference to jQuery, e.g., https://code.jquery.com/jquery-3.7.1.min.js
function downloadFile()
{
var item = {
"sourceKeys" : [ { "key" : "test/Awspackger1.png", "EntryType": "1"}]
}
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/files/download-multiple', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization' : 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
console.log(result.data[0].downloadURL);
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This method returns the download URL for the selected file or folder. The URL provides a stream that can be used to download the file. The download URL is single-use; to download the file again, a new URL must be obtained.
To get the file download URL, you need to make a POST call to the following URL :
https://fawapi.filesanywhere.com/api/v1/providerentries/files/download-multiple
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data":
[{
"key": "test/Awspackger1.png",
"entryType": 1,
"path": "/",
"downloadURL": "https://fawapi.filesanywhere.com/api/v1//api/v1/hostedstorage/215/2?path=test%2fAwspackger1.png&exp=638791939046668932&uploadAction=0&uid=5f9c8d57-f0fc-45af-a129-fc074f1c87f5&accesskey=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A&sig=afef256be548884994e43aee61ca42c8ac371a180ec2dc26af37a5acd68f4176",
"pathOwnerUserId": 2,
"downloadFileName": "Awspackger1_ReadOnly.png",
"sizeBytes": 0,
"isGroupShare": false,
"groupShareId": null,
"useVDFileExchangeApp": false,
"displayText": null,
"displayLocation": null,
"browserDownloadsAllowed": false,
"lastModified": null,
"dbPath": null,
"itemId": 0,
"userId": 0,
"userName": null,
"formattedPath": null,
"withSize": false,
"includeNestedFolders": false
}],
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
sourceKeys |
List |
File list keys to download
|
RESPONSE
Field |
Type |
Description |
key |
String |
Path Key of file |
downloadURL |
String |
File download url |
entryType |
Integer |
0 for folder, 1 for file |
Upload File
# Here is a javascript example, to upload small size file less than 4MB.
# Add a reference to jQuery, e.g., https://code.jquery.com/jquery-3.7.1.min.js
async function uploadSmallFile() {
try {
const uniqueId = uuidv4();
let prePath = jQuery("#parentKey").val() || "";
if (prePath && prePath !== "/" && !prePath.endsWith("/")) {
prePath += "/";
}
const file = $('#inputFile').prop('files')[0];
if (!file) {
throw new Error("No file selected.");
}
// Build request object
const uploadRequest = getSingleFileRequest(file, uniqueId, prePath);
// Get the upload URL
const uploadData = await getChunkUrl([uploadRequest], prePath);
// Upload the file
const uploadResponse = await doUpload(uploadData[0].url, uploadData[0].headers, file);
// Display result
console.log(JSON.stringify(uploadResponse));
} catch (error) {
console.error("Upload failed:", error.message);
console.log("Error: " + error.message);
}
}
function getSingleFileRequest(file, uniqueId, prePath) {
return {
verb: "PUT",
key: prePath + file.name,
name: file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size,
chunk: 1,
totalchunkurls: 1
};
}
function getCommitFileRequest(uniqueId, file, prePath) {
return [{
verb: "PUT",
key: prePath + file.name,
name: file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size,
chunk: 0
}];
}
async function getChunkUrl(fileRequests, prePath) {
const data = {
files: fileRequests,
parentPath: prePath,
uploadAction: 0
};
const response = await fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/corsuploadurls/folder', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'user-id': 2,
'Authorization': 'bearer ' + $("#token").val()
},
body: JSON.stringify(data)
});
if (!response.ok) {
throw new Error("Failed to fetch upload URL");
}
const resData = await response.json();
return resData.data;
}
async function doUpload(url, headers, file) {
let body = null;
if (file) {
const formData = new FormData();
formData.append("Files", file);
body = formData;
}
const response = await fetch(url, {
method: "POST",
body: body,
headers: headers
});
if (!response.ok) {
throw new Error("File upload failed");
}
return await response.json();
}
function uuidv4() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
To initiate upload process we have below options:
-
Small size file upload (less than 4 MB size)
To upload a small size file we need to submit post request on two API calls. First API (providerentries/corsuploadurls/folder), will return back the upload URL and header information.
With this upload URL and header information we need to submit post request on this URL to start upload.
-
Chunk upload process (greater than 4 MB size)
File which are larger than 4MB, we need to split the file in chunks of 4MB and then upload each chunk separately.
Initiate an API call (providerentries/corsuploadurls/folder) get all chunk urls and commit chunk url.
Once all chunks are uploaded, we need to invoke the last chunk URL which will merge all uploaded chunks.
- Upload in Azure Storage Please refer 'Upload in Azure storage' API
- Upload in AWS Upload Please refer 'Upload in AWS storage' API
Upload process is working in two steps :
- Get upload URL for the file
- Upload the file to the upload URL.
1. Get upload URL and header information by making a POST call to the following URL
https://fawapi.filesanywhere.com/api/v1/providerentries/corsuploadurls/folder
It will return back the upload URLs and header information.
The upload URL is valid for 30 minutes. After it expires, any attempt to upload will result in a 401 Unauthorized response. In such cases, you must request a new upload URL by calling the API again.
If the upload URL is modified manually or has expired, the server will return a 401 Unauthorized error. To proceed, generate a fresh upload URL by making a new API call.
Result example for get upload URL:
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": [{
"key": null,
"url": "https://fawapi.filesanywhere.com/api/v1//api-upl/api/v1/hostedstorage/215/2?path=apitest1%2fadobe1.txt&exp=638797243001668785&uploadAction=0&uid=32c4c51d-d3cf-4637-9a41-8febc8799729&accesskey=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A&sig=fdd3f782db893d18889812179d178df64307f96f99c5d5677316c8d8ce34f403",
"body": null,
"browserDownloadsAllowed": false,
"expirationDateUtc": "2025-04-08T15:51:40Z",
"headers": {
"x-fa-Content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"fas-date": "20250408T141140Z",
"host": "localhost:7178",
"sig": "fdd3f782db893d18889812179d178df64307f96f99c5d5677316c8d8ce34f403",
"authorization": "AWS4-HMAC-SHA256 Credential=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A/20250408/us-east-1/fas/aws4_request, SignedHeaders=fas-date;host;x-fa-content-sha256, Signature=fdd3f782db893d18889812179d178df64307f96f99c5d5677316c8d8ce34f403"
},
"chunked": false,
"chunkUrls": null,
"totalChunks": 0,
"explorerObject":
{
"key": "apitest1",
"displayText": "apitest1",
"entryType": 0,
"entryTypeDisplayText": null,
"lastModified": "2025-04-08T14:11:40.1674086Z",
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties":
{
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": "\\",
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"lastModified": null
}],
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
files |
List |
File list which you want to upload, sample json is like below
"files":[
{
"contentType": "multipart/form-data",
"key": "apitest1/adobe1.txt",
"name": "adobe1.txt",
"size": 60667,
"totalChunkUrls": 0,
"uid": "32c4c51d-d3cf-4637-9a41-8febc8799729",
"verb": "PUT",
"withHeaders": true
}
],
|
parentPath |
String |
Parent path key where we need to upload files. |
uploadAction |
Integer |
Need to pass 0 in this parameter |
RESPONSE
Field |
Type |
Description |
url |
String |
Upload URL which we need to invoke again to start actual upload. |
expirationDateUtc |
DateTime |
Expiration date time for this Upload URL |
headers |
JSON |
With invoking upload URL, we need to pass these headers information. |
2 Make a POST call to the upload URL with header information to initiate an upload process.
e.g. https://fawapi.filesanywhere.com/api/v1//api-upl/api/v1/hostedstorage/215/2?path=apitest1%2fpdftest.zip&exp=638797138110916437&uploadAction=0&uid=32c4c51d-d3cf-4637-9a41-8febc8799729&chunk=1&totalChunks=2&accesskey=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A&sig=4aa962e48b325b8e35bb026e6c68e43cb5c8ddcc5826fed0a1b8466092957e24
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
X-fa-Content-sha256 |
String |
This will be received from the upload URL response and needs to be passed in the header.
|
Fas-date |
String |
This will be received from the upload URL response and needs to be passed in the header.
|
Sig |
String |
This will be received from the upload URL response and needs to be passed in the header.
|
Authorization |
String |
This will be received from the upload URL response and needs to be passed in the header.
|
Chunk Upload - Large size file upload
# Here is a javascript example for large size file upload
# Add a reference to jQuery, e.g., https://code.jquery.com/jquery-3.7.1.min.js
//get each chunk url and invoke upload
async function chunkUpload() {
try {
const uniqueId = uuidv4();
let prePath = jQuery("#parentKey").val() || "";
if (prePath && prePath !== "/" && !prePath.endsWith("/")) {
prePath += "/";
}
const chunks = createChunks();
for (let i = 0; i < chunks.length; i++) {
const fileRequest = getFileChunkRequest(i + 1, uniqueId);
const uploadData = await getChunkUrl(fileRequest, prePath);
await doUpload(uploadData[0].chunkUrls[0].url, uploadData[0].chunkUrls[0].headers, chunks[i]);
}
// After all chunks are uploaded, commit the file
const commitRequest = getCommitFileRequest(uniqueId);
const commitData = await getChunkUrl(commitRequest, prePath);
const commitResponse = await doUpload(commitData[0].chunkUrls[0].url, commitData[0].chunkUrls[0].headers, null); // null or metadata only
console.log(JSON.stringify(commitResponse));
} catch (error) {
console.error("Upload failed:", error.message);
}
}
async function getChunkUrl(fileRequests, prePath) {
const data = {
files: fileRequests,
parentPath: prePath,
uploadAction: 0
};
const response = await fetch('@(apiURL)providerentries/corsuploadurls/folder', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'user-id': 2,
'Authorization': 'bearer ' + $("#token").val()
},
body: JSON.stringify(data)
});
if (!response.ok) {
throw new Error("Failed to fetch upload URL");
}
const resData = await response.json();
return resData.data;
}
async function doUpload(chunkUrl, chunkHeaders, chunk) {
const formData = new FormData();
if (chunk) {
formData.append("Files", chunk);
}
const response = await fetch(chunkUrl, {
method: "POST",
body: chunk ? formData : null,
headers: chunkHeaders
});
if (!response.ok) {
throw new Error("Chunk upload failed");
}
return await response.json();
}
function createChunks() {
const files = $('#inputFile').prop('files');
if (!files.length) return [];
const file = files[0];
const chunkSize = 4 * 1024 * 1024; // 4MB
const chunks = [];
let start = 0;
while (start < file.size) {
const end = Math.min(start + chunkSize, file.size);
chunks.push(file.slice(start, end));
start = end;
}
return chunks;
}
function uuidv4() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11)
.replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
function getFileChunkRequest(chunkNumber, uniqueId) {
const files = $('#inputFile').prop('files');
if (!files.length) return [];
const file = files[0];
let prePath = jQuery("#parentKey").val() || "";
if (prePath && prePath !== "/" && !prePath.endsWith("/")) {
prePath += "/";
}
const dirPath = prePath + file.name;
return [{
verb: "PUT",
key: dirPath,
name: file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size,
chunk: chunkNumber,
totalchunkurls: 1
}];
}
function getCommitFileRequest(uniqueId) {
const files = $('#inputFile').prop('files');
if (!files.length) return [];
const file = files[0];
let prePath = jQuery("#parentKey").val() || "";
if (prePath && prePath !== "/" && !prePath.endsWith("/")) {
prePath += "/";
}
const dirPath = prePath + file.name;
return [{
verb: "PUT",
key: dirPath,
name: file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size,
chunk: 0 // indicates commit
}];
}
This method uploads a file to the user's account in 4MB chunks. It is intended for uploading large files.
For files larger than 4MB, the file must be split into 4MB chunks, and each chunk should be uploaded separately.
The chunk upload API works in two parts:
Obtain upload URLs – Request upload URLs for each chunk and a commit URL to merge all chunks.
Upload chunks – Upload each chunk to its respective upload URL.
To get chunk upload URL, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/corsuploadurls/folder
It will return back the chunk upload URL and header information.
The upload URL is valid for 30 minutes. After it expires, any attempt to upload will result in a 401 Unauthorized response. In such cases, you must request a new upload URL by calling the API again.
If the upload URL is modified manually or has expired, the server will return a 401 Unauthorized error. To proceed, generate a fresh upload URL by making a new API call.
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data":
[{
"key": null,
"url": null,
"body": null,
"browserDownloadsAllowed": false,
"expirationDateUtc": null,
"headers": null,
"chunked": true,
"chunkUrls":
[{
"url": "https://fawapi.filesanywhere.com/api/v1/api-upl/api/v1/hostedstorage/215/2?path=apitest1%2fpdfjs-4.10.38-dist.zip&exp=638798982838477279&uploadAction=0&uid=32c4c51d-d3cf-4637-9a41-8febc8799729&chunk=1&totalChunks=2&accesskey=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A&sig=d97048aba9ee12de9b7e64c27f0c8594edd560783e70a8dc7c6f4f50a46414b3",
"chunk": 0,
"expirationDateUtc": "2025-04-10T16:11:23Z",
"headers": {
"x-fa-Content-sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"fas-date": "20250410T143123Z",
"host": "localhost:7178",
"sig": "d97048aba9ee12de9b7e64c27f0c8594edd560783e70a8dc7c6f4f50a46414b3",
"authorization": "AWS4-HMAC-SHA256 Credential=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A/20250410/us-east-1/fas/aws4_request, SignedHeaders=fas-date;host;x-fa-content-sha256, Signature=d97048aba9ee12de9b7e64c27f0c8594edd560783e70a8dc7c6f4f50a46414b3"
}
}],
"totalChunks": 2,
"explorerObject":
{
"key": "apitest1",
"displayText": "apitest1",
"entryType": 0,
"entryTypeDisplayText": null,
"lastModified": "2025-04-10T14:31:23.8900786Z",
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties":
{
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": "\\",
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"lastModified": null
}],
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
files |
List |
File list which you want to upload, sample json is like below
"files":[
{
"contentType": "multipart/form-data",
"key": "apitest1/adobe1.txt",
"name": "adobe1.txt",
"size": 60667343, //file size
"chunk": 1, //chunk number
"totalChunkUrls": 1,
"uid": "32c4c51d-d3cf-4637-9a41-8febc8799729",
"verb": "PUT",
"withHeaders": true
}
],
|
parentPath |
String |
Parent path key where we need to upload files. |
uploadAction |
Integer |
Need to pass 0 in this parameter |
RESPONSE
Field |
Type |
Description |
url |
String |
Chunk urls which needs to invoke to start upload each chunk |
headers |
String |
Headers which needs to invoke to start upload each chunk with chunk url |
expirationDateUtc |
DateTime |
Expiration date time for this Upload URL |
When we receive chunk urls, we need to post this request with each file chunk. e.g. :
https://fawapi.filesanywhere.com/api/v1//api-upl/api/v1/hostedstorage/215/2?path=apitest1%2fpdftest.zip&exp=638797138110916437&uploadAction=0&uid=32c4c51d-d3cf-4637-9a41-8febc8799729&chunk=1&totalChunks=2&accesskey=0x00599658CAA19646803AB4D3B6873C1A02000000A7DDC7CFD0084EC855D54EA5C58F94250C80436A3915D85A69FF70E8235ACAA1D4AC72A48FAA8CEAA31D5D5C3CFC9EB1426B38F2CA879BDAC41121F81DE0566A&sig=4aa962e48b325b8e35bb026e6c68e43cb5c8ddcc5826fed0a1b8466092957e24
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
X-fa-Content-sha256 |
String |
This will be received from the upload URL response. We need to pass this value in the header of the second request.
|
Fas-date |
String |
This will be received from the upload URL response. We need to pass this value in the header of the second request.
|
Sig |
String |
This will be received from the upload URL response. We need to pass this value in the header of the second request.
|
Authorization |
String |
This will be received from the upload URL response. We need to pass this value in the header of the second request.
|
BODY PARAMETERS
Field |
Type |
Description |
files |
Object |
Chunked file |
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
Upload file in Azure storage
# Here is a javascript example
var azureUpload = function ()
{
var _uid = uuidv4();
var chunks = createChunks();
var prePath = jQuery("#parentKey").val();
if (prePath && prePath != "/" && !prePath.endsWith("/"))
prePath = prePath + "/";
var currentIndex = 0;
evalAzureUploadUrl(chunks, prePath, currentIndex, _uid);
}
var evalAzureUploadUrl = function (chunks, prePath, currentIndex, uid)
{
var fileRequests = getAzureFileRequest(uid, currentIndex + 1);
var data = {
files: fileRequests,
parentPath: prePath,
uploadAction: 0
};
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/corsuploadurls/folder', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(data)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var arrData = result.data[0];
fetch(arrData.url, {
method: "PUT",
body: arrData.body == null ? chunks[currentIndex] : arrData.body,//input file object
headers: arrData.headers, //headers receive from getcorsuploadurl api
contentType: false
}).then(response => {
if (response.ok) {
console.log("chunk uploaded : " + response);
if (chunks.length > 1) {
currentIndex++;
if (currentIndex > 0 && currentIndex < chunks.length) {
evalAzureUploadUrl(chunks, prePath, currentIndex, uid);
} else if (currentIndex == chunks.length) {
//last commit request
evalAzureUploadUrl(chunks, prePath, -1, uid);
}
}
return true;
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
chunkComplete = false;
});
})
.catch(error => {
// Handle any errors here
console.log(error); // Example: Logging the error to the console
chunkComplete = false;
});
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
var getAzureFileRequest = function (uniqueId, chunk)
{
files = $('#inputFile').prop('files');
if (files.length == 0) {
return;
}
var prePath = jQuery("#parentKey").val();
if (prePath && prePath != "/" && !prePath.endsWith("/"))
prePath = prePath + "/";
var file = files[0];
file.dirPath = prePath + file.name;
var fileRequests = [];
if (file.size > 4194304) { //> 4mb chunk size
let fileRequest = {
verb: "PUT",
key: (file.dirPath || (prePath + file.webkitRelativePath)),
name: file.displayName || file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size,
chunk: chunk //for chunk upload need to pass chunk number
};
fileRequests.push(fileRequest);
}
else
{
let fileRequest = {
verb: "PUT",
key: (file.dirPath || (prePath + file.webkitRelativePath)),
name: file.displayName || file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size
};
fileRequests.push(fileRequest);
}
return fileRequests;
}
//Create chunks for a selected file by 4MB size
var createChunks = function () {
var files = $('#inputFile').prop('files');
var file = files[0];
var cSize = 4 * 1024 * 1024; //4MB chunk
let startPointer = 0;
let endPointer = file.size;
let chunks = [];
while (startPointer < endPointer) {
let newStartPointer = startPointer + cSize;
let chunk = file.slice(startPointer, newStartPointer);
chunk.dirPath = file.dirPath;
chunks.push(chunk);
startPointer = newStartPointer;
}
return chunks;
}
//Get unique Id
function uuidv4() {
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
);
}
This method upload a file in user's Azure storage account in chunk of 4MB. This method will be use for small/large size file upload.
File which are larger than 4MB, we need to split the file in chunks of 4MB and then upload each chunk separately. Once all chunks are uploaded, we need to invoke the last chunk URL which will merge all uploaded chunks.
This method will return a upload URL which we need to invoke to start the upload.
To get upload URLs, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/corsuploadurls/folder
It will return back the upload URL and header information.
The upload URL is valid for 30 minutes. After it expires, any attempt to upload will result in a 401 Unauthorized response. In such cases, you must request a new upload URL by calling the API again.
If the upload URL is modified manually or has expired, the server will return a 401 Unauthorized error. To proceed, generate a fresh upload URL by making a new API call.
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": [
{
"key": null,
"url": "https://azureblobdevqa.blob.core.windows.net/cid/4036/1004/test13/2024 Testing New Interface.xlsx?sv=2023-11-03&se=2025-04-11T11%3A02%3A02Z&sr=b&sp=w&rscd=attachment&sig=WQ%2BYF4X%2Fhs1m2sOD8BmoIBDH5W0%2FNCTA0JKJkwbU2EM%3D",
"body": null,
"browserDownloadsAllowed": false,
"expirationDateUtc": "2025-04-11T11:02:02Z",
"headers": {
"x-ms-blob-type": "BlockBlob",
"x-ms-blob-content-disposition": "attachment"
},
"chunked": false,
"chunkUrls": null,
"totalChunks": 0,
"explorerObject": {
"key": "test13",
"displayText": "test13",
"entryType": 0,
"entryTypeDisplayText": null,
"lastModified": "2025-04-11T10:32:02.3581714Z",
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties": {
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": "\\",
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"lastModified": null
}
],
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
files |
List |
File list which you want to upload, sample json is like below
"files":[{
"contentType": "multipart/form-data",
"key": "apitest1/adobe1.txt",
"name": "adobe1.txt",
"size": 60667,
"uid": "32c4c51d-d3cf-4637-9a41-8febc8799729",
"verb": "PUT",
"withHeaders": true
"chunk": 1 //Optional in case when file size is greater than 5mb then we need to pass subsequent chunk number on each call to get next chunk url
}],
|
parentPath |
String |
Parent path key where we need to upload files. |
uploadAction |
Integer |
Need to pass 0 in this parameter |
RESPONSE
Field |
Type |
Description |
url |
String |
Upload url which needs to invoke to start upload |
headers |
String |
Headers which needs to invoke to start upload |
expirationDateUtc |
DateTime |
Expiration date time for this Upload URL |
When we receive upload url, we need to PUT this request with file chunk. e.g. :
https://azureblobdevqa.blob.core.windows.net/cid/4036/1004/pdfjs-4.10.38-dist%20%281%29.zip?sv=2023-11-03&se=2025-04-15T10%3A50%3A15Z&sr=b&sp=w&rscd=attachment&sig=MxEcwZESVJ3XcRpSx8pL5R8OZeRNWdJK20WtVEBFRxQ%3D&comp=blocklist
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
X-ms-blob-type |
String |
This will be received from the upload URL response and needs to be passed in the header.
|
X-ms-blob-content-disposition |
String |
This will be received from the upload URL response and needs to be passed in the header.
|
BODY PARAMETERS
Field |
Type |
Description |
files |
Object |
Chunked file |
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
Upload file in AWS storage
# Here is a javascript example
var awsUpload = function () {
var _uid = uuidv4();
var chunks = createAwsChunks();
var prePath = jQuery("#parentKey").val();
if (prePath && prePath != "/" && !prePath.endsWith("/"))
prePath = prePath + "/";
var currentIndex = 0;
var partETags = [];
evalAwsUploadUrl(chunks, prePath, currentIndex, _uid, partETags);
}
//Create chunks for a selected file by 5MB size
var createAwsChunks = function ()
{
var files = $('#inputFile').prop('files');
var file = files[0];
var cSize = 5 * 1024 * 1024; //5MB chunk
let startPointer = 0;
let endPointer = file.size;
let chunks = [];
while (startPointer < endPointer) {
let newStartPointer = startPointer + cSize;
let chunk = file.slice(startPointer, newStartPointer);
chunk.dirPath = file.dirPath;
chunks.push(chunk);
startPointer = newStartPointer;
}
return chunks;
}
var evalAwsUploadUrl = function (chunks, prePath, currentIndex, uid, partETags) {
var fileRequests = getAwsFileRequest(uid, currentIndex + 1);
var data = {
files: fileRequests,
parentPath: prePath,
uploadAction: 0
};
fetch('@apiURL' + 'providerentries/corsuploadurls/folder', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
},
body: JSON.stringify(data)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
var arrData = result.data[0];
fetch(arrData.url, {
method: "PUT",
body: chunks[currentIndex],//input file object
headers: {
'Content-Type': 'multipart/form-data',
}
}).then(response => {
if (response.ok) {
console.log("chunk uploaded : " + response);
if (chunks.length > 1) {
currentIndex++;
partETags.push({
"partNumber": currentIndex,
"eTag": response.headers.get("Etag").replaceAll("\"", "")
});
if (currentIndex > 0 && currentIndex < chunks.length) {
evalAwsUploadUrl(chunks, prePath, currentIndex, uid, partETags);
} else if (currentIndex == chunks.length) {
//last commit request
commitAwsUploadUrl("/" + chunks[0].dirPath, uid, partETags);
}
}
return true;
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
chunkComplete = false;
});
})
.catch(error => {
// Handle any errors here
console.log(error); // Example: Logging the error to the console
chunkComplete = false;
});
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
//Commit the upload
var commitAwsUploadUrl = function (key, uid, partETags) {
var item = {
"fileUid": uid,
"fileKey": key,
"eTagPartNumbers": partETags,
}
fetch('https://fawapi.filesanywhere.com/api/v1/aws/triggercompletemultipartupload', {
method: 'POST',
headers: {
'Authorization': 'bearer eyJhbGciOiJIU...',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId': 2,
'content-Type': 'application/json',
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
console.log("chunk uploaded : " + response);
return true;
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
var getAwsFileRequest = function (uniqueId, chunk)
{
files = $('#inputFile').prop('files');
if (files.length == 0) {
return;
}
var prePath = jQuery("#parentKey").val();
if (prePath && prePath != "/" && !prePath.endsWith("/"))
prePath = prePath + "/";
var file = files[0];
file.dirPath = prePath + file.name;
var fileRequests = [];
if (file.size > 5242880) //> 5mb
{
let fileRequest = {
verb: "PUT",
key: (file.dirPath || (prePath + file.webkitRelativePath)),
name: file.displayName || file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size,
chunk: chunk
};
fileRequests.push(fileRequest);
}
else
{
let fileRequest = {
verb: "PUT",
key: (file.dirPath || (prePath + file.webkitRelativePath)),
name: file.displayName || file.name,
contentType: "multipart/form-data",
withHeaders: true,
uid: uniqueId,
size: file.size
};
fileRequests.push(fileRequest);
}
return fileRequests;
}
This method upload a file in user's AWS storage account in chunk of 5MB. This method will be use for small/large size file upload.
File which are larger than 5MB, we need to split the file in chunks of 5MB and then upload each chunk separately. Once all chunks are uploaded, we need to invoke the last chunk URL which will merge all uploaded chunks.
This method will return an upload URL which we need to invoke to start the upload.
To get upload URLs, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/corsuploadurls/folder
It will return back the upload URL and header information.
If the upload URL is modified manually or has expired, the server will return a 401 Unauthorized error. To proceed, generate a fresh upload URL by making a new API call.
The upload URL is valid for 30 minutes. After it expires, any attempt to upload will result in a 401 Unauthorized response. In such cases, you must request a new upload URL by calling the API again.
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data":
[{
"key": null,
"url": "https://fa-test-bucket.s3.amazonaws.com/2122/5/gee/pdfjs-4.10.38-dist.zip?AWSAccessKeyId=xxxxx&Expires=1744715189&response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27pdfjs-4.10.38-dist.zip&Signature=PO4CDFSM1du%2BcYlMGTUsUSo5NGI%3D",
"body": null,
"browserDownloadsAllowed": false,
"expirationDateUtc": "2025-04-15T11:06:28Z",
"headers": {
"x-Amz-Content-Sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"x-Amz-Date": "20250415T103628Z",
"host": "fa-test-bucket.s3.amazonaws.com",
"authorization": "AWS4-HMAC-SHA256 Credential=xxxx/20250415/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=xxx"
},
"chunked": false,
"chunkUrls": null,
"totalChunks": 0,
"explorerObject":
{
"key": "gee",
"displayText": "gee",
"entryType": 0,
"entryTypeDisplayText": null,
"lastModified": "2025-04-15T10:36:28.6551555Z",
"sizeBytes": 0,
"size": null,
"iconInfo": null,
"versionId": null,
"deleted": false,
"isLatest": false,
"fileFolderProperties":
{
"isVersionHistoryEnabled": false,
"versionKeep": null,
"isDeleteDisabled": false,
"isCheckoutEnabled": false,
"isGroupShared": false,
"groupSharePermission": 0,
"groupShareBy": null,
"groupShareByUserId": 0,
"groupShareCreatedOn": null,
"groupShareExpiredOn": null,
"isFileCheckedOut": false,
"fileCheckedOutComments": null,
"fileCheckedOutUserName": null,
"fileCheckedOutDate": null
},
"parentKey": null,
"displayLocation": "\\",
"displayKey": null,
"owner": null,
"noOfFiles": 0,
"noOfFolders": 0
},
"lastModified": null
}],
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
files |
List |
File list which you want to upload, sample json is like below
"files":[
{
"contentType": "multipart/form-data",
"key": "apitest1/adobe1.txt",
"name": "adobe1.txt",
"size": 60667,
"uid": "32c4c51d-d3cf-4637-9a41-8febc8799729",
"verb": "PUT",
"withHeaders": true,
"chunk": 1 //Optional in case when file size is greater than 5mb then we need to pass subsequent chunk number on each call to get next chunk url
}
],
|
parentPath |
String |
Parent path key where we need to upload files. |
uploadAction |
Integer |
Need to pass 0 in this parameter |
RESPONSE
Field |
Type |
Description |
url |
String |
Upload url which needs to invoke to start upload |
headers |
String |
Headers which needs to invoke to start upload |
expirationDateUtc |
DateTime |
Expiration date time for this Upload URL |
When we receive upload url, we need to PUT this request e.g. :
https://fa-test-bucket.s3.amazonaws.com/2122/5/gee/pdfjs-4.10.38-dist.zip?AWSAccessKeyId=xxxx&Expires=1744715189&response-content-disposition=attachment%3B%20filename%2A%3DUTF-8%27%27pdfjs-4.10.38-dist.zip&Signature=PO4CDFSM1du%2BcYlMGTUsUSo5NGI%3D
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": null,
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
content-type |
String |
multipart/form-data |
BODY PARAMETERS
Field |
Type |
Description |
files |
Object |
Chunked file |
Get upload path for client
# Here is a javascript example to get upload path
function getdefaultuploadpath() {
fetch('https://fawapi.filesanywhere.com/api/v1/providerentries/getaddonuploadpath', {
method: 'POST',
headers: {
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'X-UserId':2,
'Authorization': 'bearer eyJhbGciOiJIU...'
}
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
$("#uploadPath").val(result.data.uploadPath);
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
Returns the upload path to which client applications will upload files.
To get the path to which client applications will upload files, make a POST request To following url :
https://fawapi.filesanywhere.com/api/v1/providerentries/getaddonuploadpath
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"uploadPath": "- FileShare/2025-04-18/17.49.47/",
"storageProviderType": 6,
"availableSecurities": [
{
"disabled": false,
"group": null,
"selected": false,
"text": "None",
"value": "0"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "Password",
"value": "1"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "OTP - Email",
"value": "2"
},
{
"disabled": false,
"group": null,
"selected": false,
"text": "OTP - SMS",
"value": "3"
}
],
"settingsSmsOtpEnabled": false,
"settingsPasswordRequired": false,
"parallelUploadCountWindowsClient": 3,
"parallelUploadCountMacClient": 1,
"maxUploadSize": 4194304,
"displayLocation": "\\- FileShare\\2025-04-18\\17.49.47\\"
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Authentication Endpoint) |
X-UserId |
Integer |
User’s id (can be acquired from the Authentication Endpoint) |
X-Uid |
String |
Unique GUID |
RESPONSE
Field |
Type |
Description |
uploadPath |
String |
The path to which Client Applications will upload files |
storageProviderType |
Integer |
Storage provider e.g. FileAnywhere Hosted storage - 6, AWS - 0, Azure blob - 3, Azure datalake - 5 |
Admin Login
# Here is a javascript example
function logintest()
{
var item = {
"clientId": 215,
"userName":'adminuser',
"password": 'password'
};
fetch('https://fawapi.filesanywhere.com/api/v1/auth/adminlogin', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
console.log(JSON.stringify(result.data));
$("#token").val(result.data.token);
$("#deviceid").val(result.data.mfaDataModel.mfaUniqueId);
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
$("#response").html(error); // Example: Logging the error to the console
});
}
This method logs private site administrator into your FilesAnywhere account and starts an API session.
To authenticate, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/auth/adminlogin
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"errorResponse": null,
"adminUserName": "ADMINNSDL",
"adminId": 35,
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...."
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
BODY PARAMETERS
Field |
Type |
Description |
clientId |
Integer |
Private site client id for a FilesAnywhere private site.
|
username |
String |
Private site admin username.
|
password |
String |
admin user's password
|
LOGIN RESPONSE
Field |
Type |
Description |
token |
String |
An authentication Token ID to be used in subsequent API calls |
adminId |
Integer |
Administrator Id.
|
adminUserName |
String |
Administrator UserName
|
Admin User Add
# Here is a javascript example
function logintest()
{
var item = {
"userName": 'newuser',
"password": 'password',
"confirmPassword": 'password',
"firstName": "testfname",
"lastName": "testlname",
"emailAddress": "test@faw.com",
"divisionCode": "NSDL",
"defaultStorageSize": 1234,
"sendDetailsToUser": true,
"groupList" : ["development", "contracter"],
"groupShareList" : [ {"key":"fawtest", "shareNote":"sharing note", "permission": 5, "customexpirationtime": "2025-05-29 01:12:12", "sharedByUserName":"fawuser" }],
"mfaApplyLevel": 2,
"isMFAEnabled": true,
"mfaDeliveryMethod": 1,
"isBypassMFA": true,
"mfaBypassDays": 5,
"mfaDestinationSource": "useremail@faw.com",
"enableSFTP": true,
"sftpHomeFolder": "\\fawuser\\delme\\",
"enableFTP": true,
"ftpHomeFolder": "\\fawuser\\delme\\",
"enableWebDav": true,
"webdavHomeFolder": "\\fawuser\\delme\\",
"IsSsoUser": false,
"SSOType": 0,
"IsMixedSSOUser": false,
"UserPrincipalName": "apisso3"
};
fetch('https://fawapi.filesanywhere.com/api/v1/adminuser/addnewuser', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-ApiKey': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba',
'Authorization': 'bearer eyJhbGciOiJIU...',
'X-UserId': 0,
'X-Uid': 'xx8bd791-a952-4f02-9f1b-ad70a5c2d1ba'
},
body: JSON.stringify(item)
})
.then(response => {
if (response.ok) {
let resJson = response.json();
resJson.then(result => {
console.log(JSON.stringify(result.data));
$("#newuserid").val(result.data.userId);
});
return; // Parse the response data as JSON
}
let errorResponse = response.json();
errorResponse.then(error => {
console.log(JSON.stringify(error));
console.log(error.errorCode + ":" + error.message);
});
})
.catch(error => {
// Handle any errors here
});
}
This function allows the Private Site Administrator to add a new user to the Private Site.
NOTE: This function is only available for Private Sites (not for individual or workgroup FilesAnywhere accounts). Please contact FilesAnywhere Support if you are interested in the Private Site offering and wish to use this function to maintain users.
To add a new user, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/adminuser/addnewuser
Result example :
{
"success": true,
"processedAsync": false,
"asyncTaskId": null,
"errorCode": null,
"errorCodes": null,
"data": {
"userId": 31125,
"userName": "NAPIMFA5"
},
"message": null
}
REQUEST HEADERS
Field |
Type |
Description |
X-ApiKey |
String |
Your API key. |
Content-Type |
String |
application/json
|
Accept |
String |
application/json
|
Authorization |
String |
User’s authentication bearer token, e.g. bearer ___ (Token can be acquired from the Admin Authentication Endpoint) |
X-UserId |
Integer |
User’s id (it will 0 as new user is not created yet) |
X-Uid |
String |
Unique GUID |
BODY PARAMETERS
Field |
Type |
Description |
username |
String |
Unique alphanumeric ID that the user is required to enter to login into his/her account.
|
password |
String |
Password the user is required to enter to access its account.
When user is pure SSO then supplied password will not be applicable.
|
sendDetailsToUser |
Boolean |
User will receive welcome email or not.
|
divisionCode |
String |
Division to which the new user is added. It is the code that was assigned to a Division in the Organization.
|
regionName |
String |
Region which decides storage area to which user file/folder will be placed.
When account is not on different regions then default value needs to be passed as “Default Region”
|
defaultStorageSize |
Integer |
StorageSize sets the storage capacity for the user in its own personal storage account.
|
firstName |
String |
First name of the new user
|
lastName |
String |
Last name of the new user
|
emailAddress |
String |
New user’s email address. All the FilesAnywhere emails including the user password and its other account details will be sent to this email address.
|
companyName |
String |
(Optional) Company name of new User
|
jobTitle |
String |
(Optional) Job Title of new User
|
cellPhone |
String |
(Optional) Cell Phone of new User
|
address |
String |
(Optional) Address of new User
|
city |
String |
(Optional) City of new User
|
state |
String |
(Optional) State of new User
|
zip |
String |
(Optional) Zipcode of new User
|
country |
String |
(Optional) Country of new User
|
groupList |
String[] |
(Optional) List of existing groups to which new user will be added, e.g. [ "contractor", "Development"]
|
groupShareList |
Groupshares[] |
(Optional) List of existing group share folders to which new user will be assigned with specific permission, e.g.
[
{
"Key": "delme",
"ShareNote" : "Test",
"Permission": 5,
"ExpirationTime":1,
"CustomExpirationTime" : "2025-05-29 01:12:12",
"SharedByUserName" : "TestUser5"
}
],
Key |
String |
Group share folder key to which new user will be assigned with specific permission |
ShareNote |
String |
Share note which will be visible to new user |
Permission |
Integer |
Permission to be assigned to new user for this group share folder, e.g. 0 - Read Only, 1 - Preview only, 2 - Upload only, 3 - Create or update, 4 - Master access, 5 - Full Access
|
ExpirationTime |
Integer |
(Optional) Expiration time for this group share folder, e.g. 1 - Custom, 2 - 24 hours, 3 - 48 hours, 5 - 5 days, 10 - 10 days, 15 - 15 days, 30 - 30 days, 60 - 60 days, 90 - 90 days, 180 - 180 days, 11 - 1 year, 12 - Never expires
|
CustomExpirationTime |
String |
(Optional) If ExpirationTime is passed as 1 (custom) then need to pass Custom expiration date for this group share folder, e.g. "2025-05-29 01:12:12"
|
SharedByUserName |
String |
(Optional) If this group share folder is shared by some user then this value will be that user name.
|
|
isMFAEnabled |
Boolean |
(Optional) Is MFA enabled for this user or not. Default is false.
|
mfaApplyLevel |
Integer |
(Optional) MFA apply at site level (0), group level (1) or user level (2)
|
mfaDeliveryMethod |
Integer |
(Optional) MFA delivery method (0 - None, 1 - UserDefined, 2 - SMS, 3 - Phone call, 4 - Email, 11 - Authenticator App)
|
isBypassMFA |
Boolean |
(Optional) is bypass MFA or not
|
mfaBypassDays |
Integer |
(Optional) MFA bypass days
|
mfaDestinationSource |
String |
(Optional) If MFA delivery method is set as an Email then this value will be email address on which verification code will be sent. If delivery method is SMS/Phone Call then this value will be phone number on which verification code will be sent.
|
enableSFTP |
Boolean |
(Optional) If this flag is set as “true” the user can access personal folder and/or shared folder through SFTP.
|
sftpHomeFolder |
String |
(Optional) If EnableSFTP flag is set to true then FolderPath will be set as SFTP root, e.g \Username\Folder\
|
enableFTP |
Boolean |
(Optional) If this flag is set as “true” the user can access personal folder and/or shared folder through SFTP.
|
ftpHomeFolder |
String |
(Optional) If EnableFTP flag is set to true then FolderPath will be set as FTP root, e.g \Username\Folder\
|
enableWebDav |
Boolean |
(Optional) If this flag is set as “true” the user can access personal folder and/or shared folder through WebDav.
|
webdavHomeFolder |
String |
(Optional) If EnableWebDav flag is set to true then FolderPath will be set as WebDav root, e.g \Username\Folder\
|
isSsoUser |
Boolean |
(Optional) Indicates if newly created user is SSO user or not.
|
isMixedSSOUser |
Boolean |
(Optional) Indicates if newly created user is a mixed SSO user or not.
|
userPrincipalName |
String |
(Optional) When SSO user is created then Unique identity of Identity provider can be supplied here.
When the UserPrincipalName field remains blank then email address will be used to authenticate the user with SSO parameter.
|
RESPONSE
Field |
Type |
Description |
userId |
Integer |
Newly created user's Id.
|
userName |
String |
Newly created user's name.
|
Errors
200 |
OK |
Everything worked as expected. |
400 |
Bad Request |
There was an error with the request. This could be due to missing parameters, invalid data, or other issues. |
401 |
Unauthorized |
The request requires user authentication. This could mean that the API key is missing or invalid, or that the user is not logged in. |
402 |
Request Failed |
The parameters were valid but the request failed. |
403 |
Forbidden |
The server understood the request, but it refuses to authorize it. This could be due to insufficient permissions or access rights. |
404 |
Not Found |
The requested resource could not be found. This could mean that the endpoint does not exist or that the resource is not available. |
500 |
Internal Server Error |
An unexpected error occurred on the server. This could be due to a bug or an issue with the server configuration. |