CopyItems
This method copies items into your FilesAnywhere API clipboard. The items are copied over to the new location in the next Paste call, after which they are removed from the clipboard. If another CopyItems method or CutItems method is called before a Paste call, the items in the clipboard get replaced by the newly selected items of the CopyItems or CutItems call.
Syntax
CopyItemsResult = CopyItems(Token, ItemsToCopy)
Usage
Use the CopyItems method to copy one or more items into your FilesAnywhere API clipboard for the purpose of copying from one location to another by issuing a subsequent Paste call.
The following parameters are needed to make the CopyItems call:
-
Token (The Token ID returned by the last AccountLogin call).
-
ItemsToCopy is an array of type Item. An item is defined by the following two parameters:
-
Type. This is the Item type and can either be a ‘file’ or a ‘folder’.
-
Path (Name of the item with the FilesAnywhere Path). The Path should be formatted like \UserVolume\FolderName\ItemName, where UserVolume is the FilesAnywhere UserName in whose account the item exists.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /fawapi.asmx HTTP/1.1
Host: api.filesanywhere.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://api.filesanywhere.com/CopyItems"
string
-
string
string
-
string
string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
string
boolean
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /fawapi.asmx HTTP/1.1
Host: api.filesanywhere.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
string
-
string
string
-
string
string
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
Response xmlns="http://api.filesanywhere.com/">
string
boolean
Sample Visual Basic.Net Code
Private Sub CopyItems()
Dim FAWAPI As New WebReference.FAWAPI
Dim CopyItemsResult As New WebReference.CopyItemsResult
CopyItemsResult = FAWAPI.CopyItems(Token, ItemsToCopy)
If Not CopyItemsResult.Copied Or CopyItemsResult.ErrorMessage <>
"" Then
Msgbox CopyItemsResult.ErrorMessage
End If
CopyItemsResult = Nothing
FAWAPI = Nothing
End Sub
Request Arguments
Name
|
Data Type
|
Required
|
Description
|
Token
|
String
|
Yes
|
The Token ID returned back in the last AccountLogin call
|
ItemsToCopy
|
Array of type Item
|
Yes
|
An array of items.
|
Item Properties
An Item has the following properties:
Property Name
|
Data Type
|
Required
|
Description
|
Type
|
String
|
Yes
|
Type can either be a ‘file’ or a ‘folder’
|
Path
|
String
|
Yes
|
Full FilesAnywhere path of the Item in the form \UserVolume\FolderName\ItemName
|
Response
CopyItemsResult
CopyItemsResult Properties
CreateFolder
This method creates a new folder in the specified path.
Syntax
CreateFolderResult = CreateFolder(Token, Path, NewFolderName)
Usage
Use the CreateFolder method to create a new folder.
The following parameters are needed to make the CreateFolder call:
-
Token (The Token ID returned by the last AccountLogin call).
-
Path (Full FilesAnywhere Path). This is the FilesAnywhere Path of the folder inside which the new folder will be created. The Path should be formatted like \UserVolume\FolderName, where UserVolume is the FilesAnywhere UserName in whose account the folder will be created and FolderName is the folder or subfolder where the new folder will be created.
-
NewFolderName is the name of the new folder.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /fawapi.asmx HTTP/1.1
Host: api.filesanywhere.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://api.filesanywhere.com/CreateFolder"
string
string
string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
string
boolean
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /fawapi.asmx HTTP/1.1
Host: api.filesanywhere.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
string
string
string
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
string
boolean
Sample Visual Basic.Net Code
Private Sub CreateFolder()
Dim FAWAPI As New WebReference.FAWAPI
Dim CreateFolderResult As New WebReference.CreateFolderResult
CreateFolderResult = FAWAPI.CreateFolder(Token, Path,
NewFolderName)
If Not CreateFolderResult.FolderCreated Or
CreateFolderResult.ErrorMessage <> "" Then
Msgbox CreateFolderResult.ErrorMessage
End If
CreateFolderResult = Nothing
FAWAPI = Nothing
End Sub
Request Arguments
Name
|
Data Type
|
Required
|
Description
|
Token
|
String
|
Yes
|
The Token ID returned back in the last AccountLogin call
|
Path
|
String
|
Yes
|
Full FilesAnywhere path of the folder or subfolder in the form \UserVolume\FolderName
|
NewFolderName
|
String
|
Yes
|
The name of the new folder
|
Response
CreateFolderResult
CreateFolderResult Properties
Name
|
Data Type
|
Description
|
ErrorMessage
|
String
|
A description of the error, if any error was encountered while the CreateFolder method was executed. If the CreateFolder call was successful, the ErrorMessage is blank
|
FolderCreated
|
Boolean
|
True or False indicating whether the CreateFolder call was a success or a failure
|
CreateFolderRecursive
This method creates a new folder in the specified path. If any of the parent folders in the specified path don’t exist then it creates those parent folders also, before creating the specified new folder.
Syntax
CreateFolderRecursiveResult = CreateFolderRecursive(Token, Path, NewFolderName)
Usage
Use the CreateFolderRecursive method to create a new folder. If any of the parent folders in the specified path don’t exist then those parent folders are created before creating the specified new folder.
The following parameters are needed to make the CreateFolderRecursive call:
-
Token (The Token ID returned by the last AccountLogin call).
-
Path (Full FilesAnywhere Path). This is the FilesAnywhere Path of the folder inside which the new folder will be created. The Path should be formatted like \UserVolume\FolderName1\FolderName2\, where UserVolume is the FilesAnywhere UserName in whose account the folder will be created and FolderName is the folder or subfolder where the new folder will be created. It is not necessary that FolderName1 orFolderName2 exist. They will be created by this function.
-
NewFolderName is the name of the new folder.
SOAP 1.1
The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.
POST /v2/fawapi.asmx HTTP/1.1
Host: api.cloudpc.me
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://api.filesanywhere.com/CreateFolderRecursive"
string
string
string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
string
boolean
string
SOAP 1.2
The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.
POST /v2/fawapi.asmx HTTP/1.1
Host: api.cloudpc.me
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
string
string
string
HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length
string
boolean
string
Sample Visual Basic.Net Code
Private Sub CreateFolderRecursive()
Dim FAWAPI As New WebReference.FAWAPIv2SoapClient
Dim CreateFolderRecursiveResult As New WebReference.CreateFolderRecursiveResult
CreateFolderRecursiveResult = FAWAPI.CreateFolderRecursive(Token, Path,
NewFolderName)
If Not CreateFolderRecursiveResult.FolderCreated Or
CreateFolderRecursiveResult.ErrorMessage <> "" Then
Msgbox CreateFolderRecursiveResult.ErrorMessage
End If
CreateFolderRecursiveResult = Nothing
FAWAPI = Nothing
End Sub
Request Arguments
Name
|
Data Type
|
Required
|
Description
|
Token
|
String
|
Yes
|
The Token ID returned back in the last AccountLogin call
|
Path
|
String
|
Yes
|
Full FilesAnywhere path of the folder or subfolder in the form \UserVolume\FolderName1\FolderName2\
|
NewFolderName
|
String
|
Yes
|
The name of the new folder
|
Response
CreateFolderRecursiveResult
CreateFolderRecursiveResult Properties
Name
|
Data Type
|
Description
|
ErrorMessage
|
String
|
A description of the error, if any error was encountered while the CreateFolder method was executed. If the CreateFolder call was successful, the ErrorMessage is blank
|
FolderCreated
|
Boolean
|
True or False indicating whether the CreateFolder call was a success or a failure
|
NewFolderName
|
String
|
If the new folder name sent in request contains “.” Or “..” or a space in the beginning then it will be removed from the name and the new name will be passed in the reponse through NewFolderName
|
Share with your friends: |