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

Box API -- Uploaded file not seen

New post

Comments

9 comments

  • vkal

    Also please let me know if I missed out any steps or if I have any additional setup or if there is any api guide/documentation for this. 

    Thanks

    0
    Comment actions Permalink
  • Emily Marshall
    Hi there! 
     
    Great question! A service account is an API-only account. What this means is that files and folders can't be accessed through the box Webapp. There are two ways you can access this content:
    • Via the API. You can make an API call with an application level token to manage content and access the content within the service account. For example, our get files endpoint! 
    • In the Content Manager Tab located within the Admin console. Within your admin console, select the content manager tab, and select the application name that you would like to view content for! 
     
    We have a great page that provides more information on this: https://developer.box.com/docs/service-account 
     
    0
    Comment actions Permalink
  • vkal

    Thank you for your response. Reviewing the reference you gave, I see that since it is api-only account, it wont come up in the web-app.  As follow-up to my requirement or as a workaround, I was wondering if we create a folder under the service-account and add collaborators (they will be the  enterprise users or the managed users) to that folder, then will it show up under my or other managed users accounts.

    So, to test that, I used the java sdk for the box apis and created a folder under the root-folder using the apis. Then I tried to add a collaborators (an enterprise user or a managed user) to the folder, using the java api's, "BoxFolder.collaborate"  , but it is throwing an error. Any idea what could be the reason. Below is the exception.

    --------------

    Exception in thread "main" com.box.sdk.BoxAPIException: The API returned an error code: 400
    {"type":"error","status":400,"code":"bad_request","context_info":{"errors":[{"reason":"missing_parameter","name":"login","message":"'login' is required"}]},"help_url":"http:\/\/developers.box.com\/docs\/#errors","message":"Bad Request","request_id":"ik0oejfz7d3522bb"}
    at com.box.sdk.BoxAPIResponse.(BoxAPIResponse.java:85)
    at com.box.sdk.BoxJSONResponse.(BoxJSONResponse.java:32)
    at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:479)
    at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:265)
    at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:240)
    at com.box.sdk.BoxFolder.collaborate(BoxFolder.java:164)
    at com.box.sdk.BoxFolder.collaborate(BoxFolder.java:131)
    at com.example.boxintegration.MyBoxUtil.addCollaboratorToFolder(MyBoxUtil.java:154)
    at com.example.boxintegration.test.TestBoxClientUtil.main(TestBoxClientUtil.java:15)

    ---------------------------

     I didnt get why it is saying "login is required", even though it is a api-only account and the authentication is already handled using the JWT file.

     

    Thanks

     

    0
    Comment actions Permalink
  • vkal

    Hi can someone please comment or throw a pointer. I am kind a stuck here. I dont want to engage our "enterprise-admin" to add collaborators to folders under the service-account, which I created, since me or my team wants to manage the folders and data under that service-account.  Please help. 

     

    Thanks

    0
    Comment actions Permalink
  • Kourtney

     on the backend I'm seeing the error is [missing_parameter]+=>+Collaborator+id+or+login+required. Are you passing one of these in your call? 

    0
    Comment actions Permalink
  • vkal

    Thanks for responding Kourt.


    I didnt gave a "userID", since I didnt how to get that information. But I gave "emailAddress" to the api as below.

     

    folder = new BoxFolder(client, folderID); //I provided the folderID, client and the complete emailAddress (as @.com) through a wrapper.
    BoxCollaboration.Info collabInfo;
    if (userID == null && userID.isEmpty()) {
    collabInfo = folder.collaborate(emailAddress,BoxCollaboration.Role.EDITOR);
    }

     

    0
    Comment actions Permalink
  • vkal

     

    Any idea what wrong with the code snippet from my previous reply.  Please help.

     

    Thanks

    0
    Comment actions Permalink
  • Kourtney

     Can you please open a support ticket at support.box.com so we can further assist? 

     

    Best, 

    Kourtney 

    0
    Comment actions Permalink
  • mahesh25g

    Thank you!

     

    If you created an app, all the uploded files will be in the App folder. inside a content maneger . You can't view in the main folder. 

    0
    Comment actions Permalink

Please sign in to leave a comment.