5

I have a rest API to upload multiple files. It returns an ID per file uploaded and a message, per file as well, which tells which error has occurred, if any.

Should I always return 200 with the json?

what if all files failed? and what if some files only have failed?

Thomas
  • 10,933
  • 14
  • 65
  • 136
  • 1
    Possible duplicate of [HTTP status code for a partial successful request](https://stackoverflow.com/questions/8472935/http-status-code-for-a-partial-successful-request) – jonrsharpe Aug 27 '17 at 10:44
  • 1
    here is the quick lookout https://httpstatuses.com/ i think of 202 and 207 as to choose from as suggested by previous link – RohitS Aug 27 '17 at 10:48
  • The other link was useful; I'll use a 207. Thanks! – Thomas Aug 27 '17 at 11:58
  • This [link](https://www.restapitutorial.com/httpstatuscodes.html) is also useful for people that see this question after long time like me – GameO7er Aug 07 '19 at 11:55

0 Answers0