The API returned an error [NotFound | Xxxxxxxxx.] not_found - Not Found while uploading a file using creating admin client with JWTAuth
Hello, I am uploading a file using below code. But I am getting an exception from uploadAsync method as
"The API returned an error [NotFound | Xxxxxxxxx.] not_found - Not Found"
var config = new BoxConfigBuilder(clientID , clientSecret , enterpriseID , privateKey , passphrase , publicKeyID) .Build(); var boxJWT = new BoxJWTAuth(config); var token = await boxJWT.AdminTokenAsync(); var client = boxJWT.AdminClient(token); using (FileStream stream = new FileStream(file2ToUpload, FileMode.Open)) { BoxFileRequest req = new BoxFileRequest() { Name = $"Book2_{DateTime.Now.ToString("MM/dd/yyyy").Replace("/", "_")}.xlsx", Parent = new BoxRequestEntity() { Id = folderID } }; var newFile = await client.FilesManager.UploadAsync(req, stream); }
If I upload using developer token, it works fine.
What could be wrong?
-
I imagine what's happening is that your service account that was created when you made your Box app is not collaborated into the folder you want to upload the file into. Dev tokens tie back to your user...
Alex, Box Developer Advocate
投稿コメントは受け付けていません。
コメント
2件のコメント