简体   繁体   中英

Boxapi: Move/copy admin files to service account

I have been using box since from a year. I manually upload files to Box. A few days back I integrated my nodejs code to Box (api's). I have created an app and set up Client Credentials Grant Authentication, which is a service account by default and I am able to upload files and folders. But I already have hundreds of files in my admin account. And instead of creating all those files again under my new service account, I want to move all those content to the service account. I read the docs about de-provision, but I am not sure if that is what I am looking for. Any suggestions on how can I do this?. Thanks in advance.

Finally, I found the solution. There are two ways(maybe more, but I found these two) to achieve this.

  1. Transfer Owned Folders
    const sourceUserID = 'exaplesourceId';
    const destinationUserID = 'exampleuserId';
    client.enterprise.transferUserContent(sourceUserID, destinationUserID)
        .then((movedFolder) => {
            resolve(movedFolder);
        }).catch((error) => {
            reject(error);
        });

For reference: https://developer.box.com/guides/users/deprovision/transfer-folders/

  1. The other way is to give access to the service account user to collaborate on existing content. We can do this via the API too.

Reference: https://developer.box.com/guides/users/deprovision/transfer-folders/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM