I am trying to list the file contents of a given BIM360 folder using the forge .NET client to access the Autodesk's Data Management API.
GetFolderContents returns a JsonApiCollection but I am confused as to how to deserialize the response data using the SDK's model objects.
C# sample code from the documentation:
// 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 );
}
Please refer to our Hubs Browser tutorial that handles this.
Specificaly in the Data Browsing part.
You can also check the repo.