Using the File Upload API in Ruby on Rails

New post

Comments

1 comment

  • Jason

    Hi , thanks for your post! Sorry to hear about the trouble!

     

    You're right, the behavior for uploading files has changed from the View API to the New Box View (NBV) API. In the legacy View, developers could supply a remote URL for us to "fetch" OR upload a file from a local location. In the NBV, the upload behavior is now aligned (and uses the same endpoint as) Box's larger Content API. You'll need to supply the file directly:

    https://developer.box.com/reference#upload-a-file

     

    For a ruby-specific example, I looked to our Ruby SDK and found this example:

    https://github.com/cburnette/boxr#a-quick-example

     

    For Authentication, since the NBV does not use Standard OAuth2 or OAuth2 with JWT, instead favoring a longer lived token, you can create a client like you would with the "Developer Token" mentioned here (but your NBV token is long-lived, so you don't have to worry about the 60 min expiration):

    https://github.com/cburnette/boxr#creating-a-client

     

    The Ruby SDK was designed for our content API, but the endpoints called are the same as those in the NBV. It's just that the endpoints supported are pared down (see endpoints supported...):

    https://developer.box.com/v2.0/docs/getting-started-with-new-box-view

     

    The other notable difference is the level of customization available to how you want to design your Preview experience. This is a good guide to show you the difference:

    https://developer.box.com/v2.0/docs/using-box-preview-in-your-application

     

    Best regards,

    Jason

    0
    Comment actions Permalink

Please sign in to leave a comment.