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?