-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The API returned an error [NotFound | qxnb0bg5iiq5y2ly.0i3diclct8jjvinf2psftl970gr] not_found - Not Found"} System.Exception {Box.V2.Exceptions.BoxException} #579
Comments
@AdilKamal44 That error likely means that the user who you're authenticating the SDK as does not have access to the folder. I'm not sure sure you're generating the token you're plugging into |
@AdilKamal44 Are you using a developer Token or JWT Auth (since I don't see the json file I suppose it is dev token - which expires in 60 minutes). If you are using JWT, the behavior for adminclient is a bit more restrictive than using the developer token... what permissions does the App and User owning the app have? Try using the user client instead of the admin client. I use powershell.. but since it is .Net Classes.. maybe this will help
If you are using a developer token, it is fairly simple to use with Rest API and test it with Postman to see if the REST API has the same error (permissions issue)
|
Hi Sunil, |
Hi Matt, |
@AdilKamal44 If you don't see the folders you expect to under All Files, chances are that the SDK is authenticated as a different user than you expect. You can confirm this by getting the current user information: BoxUser currentUser = await client.UsersManager.GetCurrentUserInformationAsync();
Debug.WriteLine($"The current user login is {currentUser.Login}"); It's possible that the account is a Service Account, which has its own folders and files separate from your personal account. If you want the Service Account to have access to a folder from your own account, you should be able to collaborate it to that folder just like you would any other user. |
Hi Matt, |
@AdilKamal44 As I mentioned above, if you want the Service Account to have access to a folder from your own account, you should be able to collaborate it to that folder just like you would any other user. Since you have the login for that user, you should be able to just add it to whichever folder you want. |
Hi Matt, |
@AdilKamal44 You're correct — you should be able to do this from the web application by adding the service account as a collaborator on the folder you want it to have access to. If you need help with that part, please contact Box Support; they can assist you further with topics outside of the SDK. |
Matt, |
@AdilKamal44 Great — I'm glad it's working for you now! Please let us know if you run into any further issues with the SDK. |
I am using the code below and getting the exception above.
Here is my code.
static readonly string rediredUri = ConfigurationManager.AppSettings["rediredUri"];
Uri uri = new Uri(rediredUri);
string apptoken = ConfigurationManager.AppSettings["Apptoken"];
var config = new BoxConfig(CLIENT_ID, "", uri);
var session = new BoxJWTAuth(config);
var client = session.AdminClient(apptoken);
var folderId = ConfigurationManager.AppSettings["FolderID"];
var folder = await client.FoldersManager.GetInformationAsync(folderId);
The text was updated successfully, but these errors were encountered: