简体   繁体   English

如何通过BoxApi V2 .NET SDK生成上传电子邮件

[英]How to generate upload email via BoxApi V2 .NET SDK

I can't seem to find the equivalent in the BoxAPI.V2 .NET SDK to the following call: 我似乎在BoxAPI.V2 .NET SDK中找不到以下调用的等效项:

curl https://api.box.com/2.0/folders/FOLDER_ID \ 
-H "Authorization: Bearer ACCESS_TOKEN" \  
-d '{"folder_upload_email": {"access": "open"}}' \  
-X PUT

The closest that I am able to come up with is the following call signature: 我能想到的最接近的是以下呼叫签名:

BoxManager.Update(Folder folder, IEnumerable<FolderField> fields, string etag)

What appears to be missing in this call is the authorization directive ("access":"open"). 在此调用中似乎缺少的是授权指令(“ access”:“ open”)。 Any ideas? 有任何想法吗? I know I can execute this REST query using other means as well -- but that would defeat the purpose of an SDK. 我知道我也可以使用其他方式执行此REST查询-但这会违背SDK的目的。

Can you confirm which version of the .NET SDK you are using for the Box V2 API calls? 您可以确认用于Box V2 API调用的.NET SDK版本吗? The officially supported version is available at: https://github.com/box/box-windows-sdk-v2 官方支持的版本可在以下网址获得: https//github.com/box/box-windows-sdk-v2

To update the folder upload email access, you can use the following: 要更新文件夹上传电子邮件访问权限,可以使用以下方法:

        BoxFolderRequest folderReq = new BoxFolderRequest()
        {
            Id = "YOUR_FOLDER_ID",
            FolderUploadEmail = new BoxEmailRequest() {  Acesss = "open" }
        };

        BoxFolder f = await _foldersManager.UpdateInformationAsync(folderReq);

Feel free to open issues on the github page should you come across any problems. 如果您遇到任何问题,请随时在github页面上打开问题。 Thanks! 谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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