0

I've recently noticed that when I attempt to upload a file with a name that already exists, Box returns me an error with a HTTP status code of 201 (Created), but the error JSON's "status" member is 409 (Conflict).

Should I be ignoring the actual HTTP status code, and instead treating the JSON's value as the authoritative status code?

Collin Dauphinee
  • 13,664
  • 1
  • 40
  • 71

1 Answers1

0

For the time being, you should ignore the HTTP status code. We allow uploads of multiple files in a single request, each of which can have different outcomes. Say I upload 3 files in a single request:

Upload 1 => bad name Upload 2 => success Upload 3 => bad file

201 doesn't make sense here, but neither does 400. Until we've found a better solution, you should parse each file object returned to see what the result of the upload was.

seanrose
  • 8,185
  • 3
  • 20
  • 21