Welcome to the new Box Support website. Check out all the details here on what’s changed.

.NET SDK uploading files - file never appears

New post

Comments

3 comments

  • Murtza

     Your approach is correct. The steps you followed created a Service Account, which represents your application within a Box Enterprise. This application has its own content store, and depending on the permissions you enabled it also can upload files to a user's account.

     

    When you uploaded the file using the steps you described, it was stored in the application's content store. You can access the file in the Box web app by going to the Content Manager page.

     

    To upload a file to a user's account, you can use the As-User header with a Service Account. Here is the documentation for using the As-User header with our .NET SDK.

    0
    Comment actions Permalink
  • Box Product Support

    So, for me this is where the SDK, or maybe just the documentation, has failed me.  I've read all the docs and I'm still totally confused by service accounts and "app users"; why in the world there's a separate content store hidden away in a place I had no idea to look; why the content uploaded by my "service account" went in there in the first place, a feature which I haven't seen documented anywhere.  It's not clear to me how to determine the user ID for any user.  You pointed me to a feature that is so poorly documented in the SDK that half of the two sentences devoted to it are instructions to go elsewhere for instructions.

     

    Can we just use FTPS and be happy?

     

     

    0
    Comment actions Permalink
  • vance2

    This is the code you are referring to I believe. I am using JWT Authentication however, so I don't have an access token or refresh token in order to create a new OAuthSession().  Is there a way to create a box client using the JWT Authentication method? Should I be generating access and refresh tokens when authenticating with JWT?

    Thanks!

    var config = new BoxConfig(, , , , 3600, "bearer");
    
    var userId = "12345678"
    var userClient = new BoxClient(config, auth, asUser: userId);
    
    //returns root folder items for the user with ID '12345678'
    var items  = await userClient.FoldersManager.GetFolderItemsAsync("0", 500);

     

    0
    Comment actions Permalink

Please sign in to leave a comment.