Tuesday, September 18th, 2012

Upcoming V2 API Changes

By , Platform Manager

We have some upcoming changes to the V2 API that will require changes to your code. That may sound scary, but we’re providing a changeover period where both the old and new methods will work in order to make the transition easier. Here are the two methods that are going to be changing:

Creating a Folder

Currently you create a folder like so:

POST /folders/{parent id}

As you’ve probably noticed, this syntax is inconsistent with how object are created in the rest of the V2 API. It every other case, an object is created by sending a POST request to its resource type, with any metadata included in a JSON body. In order to make folders consistent with the rest of V2, you can now create folders like so:

POST /folders

with a JSON body such as

{
    "name": "Winterfell",
    "parent": {
        "id": "123456"
    }
}

Uploading a New Version of a File

We currently require an ‘If-Match’ header when deleting a file, in order to prevent race conditions. As many of API developers have noticed, files overwrites are also subject to several race conditions, which is why we’re now adding the same requirement to file overwrites. Now, when you send a request like this:

POST /files/{id}/data

you’ll be required to send in an ‘If-Match’ header with the SHA1 hash of the file:

If-Match: d0be2dc421be4fcd0172e5afceea3970e2f3d940

What to Do Next

Both the old and new methods will continue to work until October 1. After October 1, the old methods will no longer work, so be sure to update your code as soon as you can to avoid any hiccups. If you have any questions, feel free to reach out to us.

By ,

Platform Manager

See all of Sean's articles.

  • innovatology

    October 1st? Are you kidding??!!

    How do you expect us to update and deploy our apps in 12 days?! Even App Store approval can take longer than that. Then it will take weeks, if not longer, before all our users update to a new version. Besides, our apps may have a release cycle, and we have other projects, might be on vacation or sick leave, require other resources.

    It is not realistic to require apps to be updated in this timeframe, especially for such a non-essential change. Perhaps Jan 1st, or better still March 1st.

    Get real, Box.

  • http://twitter.com/benzittlau Ben Zittlau

    It appears that the file version change has already gone into effect, but in my opinion it is not yet “After October 1″!