cancel
Showing results for 
Search instead for 
Did you mean: 

WebAPI REST POST /V1/products gives a generic error in response, without any details.

0 Kudos

WebAPI REST POST /V1/products gives a generic error in response, without any details.

Feature request from karanbhomiagit, posted on GitHub Jun 29, 2016

Steps to reproduce

  1. Install Magento from develop branch.
  2. Try creating a simple product by making a call to REST API POST /V1/products.
  3. [Example] { "product": { "sku": "atoi-item", "name": "atoi-item", "status": "1", "type_id": "simple", "visibility": "4", "attribute_set_id": "4", "price": "3", "custom_attributes": [ { "attribute_code": "description", "value": "descreeeeeeption" }, { "attribute_code": "category_ids", "value": [ "1", "2" ] } ] } }

I get a response : Status code 400. Body : { "message": "Unable to save product" }

Expected result

  1. Error message in the response body should be more specific. There are so many field values that are required to be set on the request JSON, there is no way for the person making the request to identify where the request went wrong.

Actual result

  1. [Example] Error message appears: "Unable to save product".
1 Comment
apiuser
New Member

Comment from srinivasanithin, posted on GitHub Jul 05, 2016

Error messages needs to enhanced otherwise much time is getting wasting in these troubleshoot this cause for failure.