API Code to Upload file to the anonymous upload file url

新規投稿

コメント

5件のコメント

  • Alex Novotny

    Hello, 

    Unfortunately, it doesn't look like the API allows that right now. You can add the feature request to Pulse. Box uses that to creates our future roadmap. 

    Thanks, 

    Alex, Box Developer Advocate

    0
    コメントアクション パーマリンク
  • John Edwards

    thanks for the feedback.  In the meantime what would you recommend as an implementation pattern to achieve:

    • a client software package is written in python which only leverages REST API calls to
    • send a file (generally less than 50MB but could be much larger on occasions) to
    • a client-specific box read-only folder, this is a preference but not a hard requirement, 
    • a fallback similar to the 'file request' customizable page in case the platform that is sending the file does not have direct internet access
    • a simple method of creating and sharing client-level credentials but on the same box account which restricts them to that folder

     

    wrt create a Pulse feature request; my corporate okta enabled account does not permit me login access to pulse.box.com can you add this feature request for me?

    Subject: API Implementation for a file upload to the 'file request' URL.

    Group: Uploads

    Detail:

    Provide API Access for file upload to the 'file request' URL.  The existing file upload API does not provide a method for anonymous uploads to a 'file request' link. Both the bearer token and folder id are not known and are not available within the URL.  
    a possible solution would be to implement an 'OPTIONS' call to the URL to return a throw-away bearer token and the folder id so that the existing file upload API calls can be used.  

     

    regards,

     

    John.

    0
    コメントアクション パーマリンク
  • Alex Novotny

    Okay. I added your suggestion. 

    In terms of recommending an implementation pattern, I would actually reach out to our Box Consulting team. They help development teams design solutions all the time. 

    0
    コメントアクション パーマリンク
  • John Edwards

    Thanks, Alex,

    I ended up finding a mix of documented and undocumented API calls that achieved what I was hoping to achieve.  for me the following approach works; it's not as clean as I would have hoped but it works.

    1. Get the folder.id and a form.versionId from call to
      https://datarobot.app.box.com/app-api/file-request-web/public/file-request?urlId=<file request id>
    2. Get the Bearer Token from a call to
      https://datarobot.app.box.com/app-api/file-request-web/public/form-response
    3. Upload the file using the regular file upload API now that we have sufficient info to use it
      https://upload.box.com/api/2.0/files/content

     

    I was modified my file-request app to require an email address to also be submitted, and altered the call to the form-response to include this in the seeded info for the file upload but it never really applied this email address to the uploaded file; this would have been a 'nice to have' thing but for the moment all is good. 

     

    thanks for adding the request for me.

     

    regards,

    John.

    1
    コメントアクション パーマリンク
  • Thomas DeVere Wolsey

    Hello, I want to create a way to email documents to my account/specific folder or otherwise make a folder available for upload.  It seems at one time that was possible, but now I can't find how to do it. Can you provide the steps? 

    0
    コメントアクション パーマリンク

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