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


PARAMETERS +

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
    }


PARAMETERS +

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
    }



PARAMETERS +

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
    }




PARAMETERS +

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
    }





PARAMETERS +

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


PARAMETERS +

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


PARAMETERS +

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
    }




PARAMETERS +

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


PARAMETERS +

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


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

Add/Edit Item comment


    # Here is a javascript example
    function addComment() {

    var item = {
        "key" : "test/",
        "comment": "Comment update",
        "itemType": 0,
        "id": 0, //0 for new comment, for edit comment id needs to pass
        "parentId" : 0 //ParentId is used when comment is reply to another comment
    }

    fetch('https://fawapi.filesanywhere.com/api/v1/ItemComment/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 performs two operations based on ParenID parameter. a) Add comment of a file/folder. b) Add Reply of an existing comment for a file/folder.

To add/edit item's comment, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/ItemComment/createorupdate


    Result example :
    {
        "success": true,
        "processedAsync": false,
        "asyncTaskId": null,
        "errorCode": null,
        "errorCodes": null,
        "data": {
            "createdOn": "2025-03-31T12:44:57.057",
            "date": "Mar 31, 2025 12:44 PM",
            "name": "Ad A",
            "children": null,
            "itemId": 793488,
            "id": 14098,
            "parentId": null,
            "comment": "comment updated",
            "key": null,
            "itemType": 1
        },
        "message": null
    }


PARAMETERS +

Remove Item comment


    # Here is a javascript example
    function removeComment() {

    var item = {
        "id": 14103 
    }

    fetch('https://fawapi.filesanywhere.com/api/v1/itemcomment/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
        });
    }

This method removes comment of a file/folder.

To remove comment for a file/folder, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/ItemComment/delete


    Result example :
    {
        "success": true,
        "processedAsync": false,
        "asyncTaskId": null,
        "errorCode": null,
        "errorCodes": null,
        "data": null,
        "message": null
    }


PARAMETERS +

Get Item comments


    # Here is a javascript example
    function getComments() {

    fetch('https://fawapi.filesanywhere.com/api/v1/itemcomment/get?Key=test&ItemType=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...'
        } 
        })
        .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 comments list of a file/folder.

To get comment list of file/folder, you need to make a GET call to the following url :
https://fawapi.filesanywhere.com/api/v1/ItemComment/get


    Result example :
    {
    "success": true,
    "processedAsync": false,
    "asyncTaskId": null,
    "errorCode": null,
    "errorCodes": null,
    "data": [
        {
            "createdOn": "2025-03-31T13:07:00.723",
            "date": "Mar 31, 2025 01:07 PM",
            "name": "Ad A",
            "children": [],
            "itemId": 15643,
            "id": 14099,
            "parentId": null,
            "comment": "abc",
            "key": null,
            "itemType": 0
        },
        {
            "createdOn": "2025-03-31T13:07:21.993",
            "date": "Mar 31, 2025 01:07 PM",
            "name": "Ad A",
            "children": [
                {
                "createdOn": "2025-03-31T13:08:58.08",
                "date": "Mar 31, 2025 01:08 PM",
                "name": "Ad A",
                "children": null,
                "itemId": 15643,
                "id": 14101,
                "parentId": 14100,
                "comment": "new comment",
                "key": null,
                "itemType": 0
                }
            ],
            "itemId": 15643,
            "id": 14100,
            "parentId": null,
            "comment": "replay to comment",
            "key": null,
            "itemType": 0
        }
    ],
    "message": null
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

Get FileShare link Header Information


    # Here is a javascript example
    function getfsLinkHeader() {

    var item = {
        "clientId":215,
        "linkId":"8c6a68895b99a5a5a89d",
        "linkType":1,
        "password":"xxxxxxx",
        "verificationText": "entered",
        "checkboxApproval": true,
        "signature": "test",
        "coverPageSeen": true
    }


    fetch('https://fawapi.filesanywhere.com/api/v1/guestlink/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));
                });
                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 allows you to get the FileShare header information such as the information about the person sharing the link. It returns a FileShare Token that is used for validation to make subsequent calls. Think of this method as FileShare Login.

To fet FileShare header information, you need to make a POST call to the following url :
https://fawapi.filesanywhere.com/api/v1/guestlink/login


    Result example :
    {
        "success": false,
        "processedAsync": false,
        "asyncTaskId": null,
        "errorCode": "FILE_SHARE_PASSWORD_REQUIRED",
        "errorCodes": null,
        "data": {
            "authenticationType": 1,
            "formAuthType": 0,
            "token": null,
            "dateTimeFormat": null,
            "clientId": 215,
            "userId": 0,
            "userName": null,
            "coverEnabled": true,
            "coverTitle": "test coverpage title",
            "coverMessage": "cover page message",
            "checkboxApprovalTitle": "please approve",
            "verificationTitle": "Name",
            "folderUploadEnabled": false,
            "returnUrl": null,
            "returnLabel": null,
            "requireNameText": null,
            "signatureTitle": "sign here",
            "linkId": "8c6f688a5e6672bb9c69",
            "linkType": 1,
            "linkIndexId": 46646,
            "deviceUniqueId": "90AUOJG39CTNA6LPKU1ZSIASJ36LHDFOMRF49JBE773F",
            "errorCode": null,
            "sharedByName": "Ad A",
            "sharedByEmail": "jalpesh@filesanywhere.com",
            "sendToEmail": "jalpesh@filesanywhere.com",
            "autoPreview": false,
            "infoLoggingEnabled": false,
            "commentEnabled": false,
            "storageProviderType": 0,
            "isGuestMode": false,
            "dataId": 0,
            "verificationTitle2": "Position",
            "verificationTitle3": "Company",
            "verificationTitle4": "Company Address",
            "verificationEmailAddress": "Enter your email address",
            "termsApproval": "Test1234",
            "viewType": 1,
            "adobePDFViewerKey": null
        },
        "message": "Please enter a password. The password field cannot be left blank."
    }


PARAMETERS +

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
    }




PARAMETERS +

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
}




PARAMETERS +

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
    }


PARAMETERS +

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
    }


PARAMETERS +

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 :

  1. Get upload URL for the file
  2. 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
    }


PARAMETERS +

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
    }


PARAMETERS +

    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
    }


PARAMETERS +

    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
    }


PARAMETERS +

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
}


PARAMETERS +

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
    }

PARAMETERS +

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
    }

PARAMETERS +

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.