Autodesk-Forge / forge-api-dotnet-client

Forge .Net SDK: Provides .Net SDK to help you easily integrate Forge REST APIs into the application
https://www.nuget.org/packages/Autodesk.Forge/
Apache License 2.0
95 stars 70 forks source link

error 403 when calling FoldersAPI > SearchFolderContentsAsync #86

Open afshinjafari opened 3 years ago

afshinjafari commented 3 years ago

Hi, I'm trying to use FoldersAPI search method agains BIM360 Docs project but while I can use other FoldersAPI methods and functions, the SearchFolderContentsAsync method returns '403' error.

Documentation of BIM360 Docs API suggests "403 -> The request was successfully validated but permission is not granted or the application has not been white-listed. Do not try again unless you solve permissions first." however I cannot find any settings / permissions that could help. To set the Forge APP access to BIM360 Docs project I've used this article: https://forge.autodesk.com/en/docs/bim360/v1/tutorials/getting-started/manage-access-to-docs/

and this works well with accessing files and folders etc, but not search.

Here's the response content: {"jsonapi":{"version":"1.0"},"errors":[{"id":"73a8fe00-19b1-43ad-9fe8-9f8eea6ced74","status":"403","code":"USER_NOT_AUTHENTICATED","detail":"The user could not be authenticated."}]}

Any help is appreciated. Afshin

watcherkb commented 2 years ago

Maybe a little late, but you need to give right permissions/scopes Scope.DataRead, Scope.DataCreate, Scope.DataWrite