Move Folder
/documents/api/1.2/folders/{folderId}/move
Move a specified folder and its contents to a specified destination folder. The moved folder retains its globally unique identifier and all date and ownership information.
Request
- application/json
- application/xml
-
folderId: string
Globally unique identifier (GUID) for the folder.
-
accessToken(optional): string
Applink access token authorizing the current user to access this folder. This parameter is mandatory if
appLinkID
is used. It can be used as accessToken or AccessToken. -
appLinkID(optional): string
Applink ID authorizing the current user to access this folder. Any time the parameter
appLinkID
is used, a parameteraccessToken
must be provided as well. To work, this applink must have at least the contributor role granted. It can be used as appLinkID or AppLinkID. -
dAccessCode(optional): string
Access code needed to use protected public links. It needs to be sent as part of a Cookie header in the following format:
dAccessCode-<linkID>=<passcodeValue>
-
linkID(optional): string
Public link ID of a public link authorizing the current user to access this folder. To work, this public link must have the contributor role granted. It can be used as linkID or LinkID.
The request body defines details of the move folder request. Bold indicates a required value.
object
The request body defines details of the move folder request. Bold indicates a required value.
-
destinationID:
string
(Required) Specify the globally unique identifier (GUID) of the destination folder.
-
duplicateResolution(optional):
string
(Optional) Specify the TimeStampSuffix option. The name of the moved folder is given a 6-digit suffix from the system timestamp.
{
"destinationID":"FB4CD874EF94CD2CC1B60B72T0000000000100000001"
}
Response
- application/json
- application/xml
200 Response
The request was fulfilled.
object
-
destinationID(optional):
string
Globally unique identifier (GUID) of the destination folder.
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
idList(optional):
string
Globally unique identifier (GUID) of the original folder.
-
type(optional):
string
Item type
folder
.
{
"destinationID":"FB4CD874EF94CD2CC1B60B72T0000000000100000001",
"idList":"F512DA3911603E8AB84A07ACT0000000000100000001",
"type":"folder",
"errorCode":"0"
}
400 Response
Request parameters are not formatted correctly.
403 Response
Forbidden if the user does not have read permission.
404 Response
Folder ID is not found.
Examples
The following example moves the specified folder to the specified destination.
POST .../folders/F512DA3911603E8AB84A07ACT0000000000100000001/move
Request Header
None.
Request Body
{ "destinationID": "FB4CD874EF94CD2CC1B60B72T0000000000100000001" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "destinationID": "FB4CD874EF94CD2CC1B60B72T0000000000100000001", "errorCode": "0", "idList": "F512DA3911603E8AB84A07ACT0000000000100000001", "type": "folder" }
Example 2
The following example moves the specified folder to the specified destination. The example uses a public link ID because this folder is under a folder structure not owned by or shared with the current user.
POST .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518/move
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Request Body
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518", "errorCode": "0", "idList": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518", "type": "folder" }
Example 3
The following example moves the specified folder to the specified destination. The example uses a public link ID protected by an access code because this folder is under a folder structure not owned by or shared with the current user. An access code (test12345
) is submitted as part of a Cookie in the request header.
POST .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518/move
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518 Cookie: dAccessCode-LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518=test12345
Request Body
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518", "errorCode": "0", "idList": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518", "type": "folder" }
Example 4
The following example requests moving the specified folder to the specified destination. Because this folder is under a folder structure not owned by or shared with the current user, an access denied error message is returned.
POST .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518/move
Request Header
None.
Request Body
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518" }
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518", "errorCode": "-20", "errorKey": "!csFldUnableToMoveItems!csCloudItemInsufficientPrivileges,User BB,fFolderGUID:F81175D40FF57F19884AED0CB5D17B95F47087F4E518,FLD_MOVE", "errorMessage": "Unable to move items. User 'User BB' has insufficient privilege to access fFolderGUID:F81175D40FF57F19884AED0CB5D17B95F47087F4E518 with service FLD_MOVE.", "errorType": "folder", "idList": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518", "title": "Unable to move items. User 'User BB' has insufficient privilege to access fFolderGUID:F81175D40FF57F19884AED0CB5D17B95F47087F4E518 with service FLD_MOVE.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 5
The following example requests moving the specified folder to the specified destination. This folder is under a folder structure not owned by or shared with the current user, and only a public link protected by an access code is available. An error is returned because the access code was not submitted as part of the request.
POST .../folders/F81175D40FF57F19884AED0CB5D17B95F47087F4E518/move
Request Header
LinkID: LF8D36FAFAB4388BECEAC4AEB5D17B95F47087F4E518
Request Body
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518" }
HTTP Status Code
HTTP_STATUS = 403
JSON Response
{ "destinationID": "FBB72C3E28BBD1A7BCB264E1B5D17B95F47087F4E518", "errorCode": "-18", "errorKey": "!csFldUnableToMoveItems!csAccessCodeRequiredForLinkAccess", "errorMessage": "Unable to move items. The access code must be provided to access the link.", "errorType": "folder", "idList": "F81175D40FF57F19884AED0CB5D17B95F47087F4E518", "title": "Unable to move items. The access code must be provided to access the link.", "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html" }
Example 6
The following example moves the specified folder to the specified destination. The example uses an applink ID because this folder is under a folder structure not owned by or shared with the current user. The applink ID and access token are submitted in the request header.
POST .../folders/F62E96098A6F9186F94730C1B5D17B95F47087F4E518/move
Request Header
appLinkID: LF5Bxj4TPo_p4n4qWn0tbKTicR2cTUJKv7X_ng9E7ry93rRuDokPqS1d6-wKwhb_wtcGYFDsI_cNMxeKQ-HR-FXQhiVoGRTYM_MPZY8qpICfYU94mmnMjM_cvsRhKMzc0NJgvwEJfqqDwPsAVrhc8cmg== accessToken: 352FpiMmW66PeYI1Gh5b83I9CXRwZhLfYAu4TXdqpzD8uNKUBMZVVJ3ZvivUW8kQ
Request Body
{ "destinationID": "F64529EF770DCF96F029ED82B5D17B95F47087F4E518" }
HTTP Status Code
HTTP_STATUS = 200
JSON Response
{ "destinationID": "F64529EF770DCF96F029ED82B5D17B95F47087F4E518", "errorCode": "0", "idList": "F62E96098A6F9186F94730C1B5D17B95F47087F4E518", "type": "folder" }