【发布时间】:2023-02-02 00:49:06
【问题描述】:
我正在尝试使用 forge .NET 客户端列出给定 BIM360 文件夹的文件内容以访问 Autodesk 的数据管理 API。
GetFolderContents 返回一个 Json Api 集合,但我对如何使用 SDK 模型对象反序列化响应数据感到困惑。
文档中的 C# 示例代码:
// Configure OAuth2 access token for authorization: oauth2_access_code
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new FoldersApi();
var projectId = projectId_example; // string | the `project id`
var folderId = folderId_example; // string | the `folder id`
var filterType = new List<string>(); // List<string> | filter by the `type` of the `ref` target (optional)
var filterId = new List<string>(); // List<string> | filter by the `id` of the `ref` target (optional)
var filterExtensionType = new List<string>(); // List<string> | filter by the extension type (optional)
var pageNumber = 56; // int? | specify the page number (optional)
var pageLimit = 56; // int? | specify the maximal number of elements per page (optional)
try
{
JsonApiCollection result = apiInstance.GetFolderContents(projectId, folderId, filterType, filterId, filterExtensionType, pageNumber, pageLimit);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling FoldersApi.GetFolderContents: " + e.Message );
}
【问题讨论】:
标签: autodesk-forge forge autodesk-bim360