新しいBoxサポートサイトへようこそ。 変更点の詳細はこちらをご確認ください .

Uploading file to shared folder

回答済み
新規投稿

コメント

7件のコメント

  • Kourtney

    Hello , 

     

    Thanks so much for using our platform and development forum! 

     

    Without having more information, I assume you're probably making calls using a token for the service account (AutomationUser) of your JWT application. A 404 like this usually indicates that the service account has not been added as a collaborator on the folder ID you're passing, as the service account can only interact with content it's been given access to. 

     

    If this isn't the case, could you please provide the full body response you receive (including the request ID) and a date/time/timezone you receive the error. I'd be happy to take a look at our backend logs for you to see if we can get you some more information! 

     

    Best, 

    Kourtney 

    0
    コメントアクション Permalink
  • mwiller

     When working with shared items, you need to include the shared link in all API calls made to have permissions on the item.  You can use the `client.with_shared_link()` method, like this:

     

    shared_item_client = client.with_shared_link(shared_link)
    uploaded_file = shared_item_client.folder(shared_folder.id).upload_stream(test_file, "upload_test.txt")

    Note that this will only work if the shared link grants you upload permissions; this may not be the case.

    0
    コメントアクション Permalink
  • sterns1

    Hi ,

    I made this folder as a dummy, so I (as the service account) am the owner of the folder. Can I DM you to send the 404 failure? I wouldn't want the id for the shared_folder in a public post.

    0
    コメントアクション Permalink
  • sterns1

    Hi ,

        Awesome, I'm getting a new error. I am getting an insufficient permission error, which is what I would assume you were talking about. This service account is the owner of the link, so I think I should be able to change its permissions. Where is the option to allow uploading with shared links? I can't seem to be able to find it either in the folder settings or the shared link settings.

     

    Thanks!

    0
    コメントアクション Permalink
  • mwiller

     I'm not aware of the ability to upload files into a shared folder, and the API docs don't show a way to set that permission.  If the Service Account owns the folder the link points to, why do you need to use the shared link?  You should just have permission to upload into the folder or collaborate whoever needs upload access into the folder directly. 

    0
    コメントアクション Permalink
  • sterns1

    Hi ,

     

    Good to know that uploading to a shared folder isn't a thing. I guess that because it is a service account, the folder space that it has access to is something that only box-admin have access to, not what I can see when I go to the UI file store. Since I can't upload to a shared folder, I will just get access to get the info to as-user write into the folders. Thanks!

    0
    コメントアクション Permalink
  • mwiller

     That should work.  Your other option would be to use the Service Account to collaborate yourself (or any other user who needs access) to the folder. 

    0
    コメントアクション Permalink

サインインしてコメントを残してください。