Automatically copy files
I have a requirement to copy files from a source folder to target folder/sub-folders based on certain file types and conditions on a given schedule or when a file is placed in the source folder. The source folder and target folder exists within Box with different user permissions. The source files must always exits in the source folder and never be moved, only a copy of it will be copied to the target folder based on the type/criteria. Can you please suggest me an approach on how I could accomplish this requirement? I am thinking that I should use Box APIs, but suggestion or approach would be much appreciated.
Thanks
Sentha
-
Hello Sentha,
The Box API would be a good solution to your issue. You can use the copy file endpoint, which allows you to copy a file to any folder. If you want to do this every time a file is uploaded to a specific folder, I would look into the webhook endpoint. You can set a webhook on a folder, so every time a file is uploaded to the folder, an HTTP request with information on the file uploaded is sent to your server. On your server, you can implement logic that calls the copy endpoint on the file if it meets your criteria. The documentation for these endpoints can be found here: https://developer.box.com/reference
I also recommend taking a look at our SDKs, https://github.com/box/sdks. They can help you get up and running quickly. I hope this helps!
-
You can write metadata to the copied files or assign tasks with Relay. For more custom editing of the files, you would have to use the API. You can make API requests in multiple coding languages. We have SDKs to make it easy to make these requests in multiple languages. For each SDK we have documentation on how to make calls with it. If you go to any of our SDKs on github (https://github.com/box/sdks) and click docs in the SDK github repository, you will find the documentation. For example, this is the file commands documentation for the Python SDK: https://github.com/box/box-python-sdk/blob/master/docs/usage/files.md#copy-a-file. If there is a specific language you have in mind, I can point you to the documentation.
サインインしてコメントを残してください。
コメント
5件のコメント