Google Drive API - How to move shared files within shared folder (PHP -Laravel)?

Viewed 20

Scenario -

  1. I have created a folder named - "New Folder".
  2. It has 2 sub folders named - "folder-1" & "folder-2".
  3. I jhave shared the New folder with another user called John.
  4. John has uploaded 2 files into "folder-1"
  5. Now I want to move those filles from folder-1 to folder-2

I am trying to do it through web app api. whenever I am trying to move it shows this error

- "errors": [
       {
        "domain": "global",
        "reason": "cannotAddParent",
        "message": "Increasing the number of parents is not allowed"
       }

File capabilities - 
"capabilities": Google\Service\Drive\DriveFileCapabilities {#1759 ▼
    +canAcceptOwnership: false
    +canAddChildren: false
    +canAddFolderFromAnotherDrive: null
    +canAddMyDriveParent: false
    +canChangeCopyRequiresWriterPermission: false
    +canChangeSecurityUpdateEnabled: false
    +canChangeViewersCanCopyContent: false
    +canComment: true
    +canCopy: true
    +canDelete: false
    +canDeleteChildren: null
    +canDownload: true
    +canEdit: true
    +canListChildren: false
    +canModifyContent: true
    +canModifyContentRestriction: null
    +canMoveChildrenOutOfDrive: null
    +canMoveChildrenOutOfTeamDrive: null
    +canMoveChildrenWithinDrive: false
    +canMoveChildrenWithinTeamDrive: null
    +canMoveItemIntoTeamDrive: false
    +canMoveItemOutOfDrive: false
    +canMoveItemOutOfTeamDrive: null
    +canMoveItemWithinDrive: true
    +canMoveItemWithinTeamDrive: null
    +canMoveTeamDriveItem: null
    +canReadDrive: null
    +canReadRevisions: true
    +canReadTeamDrive: null
    +canRemoveChildren: false
    +canRemoveMyDriveParent: true
    +canRename: true
    +canShare: true
    +canTrash: false
    +canTrashChildren: null
    +canUntrash: false
    #internal_gapi_mappings: []
    #modelData: array:2 [▶]
    #processed: []
  }
0 Answers
Related