I have a resource that accepts array of numbers. Each number is proceed interdependently, and computation fails are expected. How should I communicate to API client "some of your numbers couldn't be proceed, but rest was successfully forwarded"?
REST API – Processing Partial POST Data in REST
api-designrest
Best Answer
It seems the most straightforward method is just returning a XML or JSON, with the numbers and status.
Per your description, I imagine a structure like this would suffice:
I also think a HTTP Status of 200 is most indicated, as the client request was successfully processed. Also you can read in the spec (emphasis mine):
Edit: Researching a little more about the status codes, I think it may be better to use
207 Multi-Status
: