question

$$anonymous$$ avatar image
0 Likes"
$$anonymous$$ Suspended asked

Returning 204 No content

I am trying to make a call to create Inventory Item. But I am getting a 204 response with No content. $access_token="xyz_long_alphanumeric_string" $data='{ "availability": { "pickupAtLocationAvailability": [{ "availabilityType": "IN_STOCK", "fulfillmentTime": { "unit": "DAY", "value": "2" }, "merchantLocationKey": "Warehouse-1", "quantity": 50 }], "shipToLocationAvailability": { "quantity": 50 } }, "condition": "NEW", "conditionDescription": "good", "packageWeightAndSize": { "dimensions": { "height": 12, "length": 12, "unit": "INCH", "width": 200 }, "packageType": "CARS", "weight": { "unit": "KILOGRAM", "value": 12 } }, "product": { "aspects": { "Brand": ["GoPro"], "Storage Type": ["Removable"] }, "brand": "new_brand", "description": "good", "imageUrls": [ " https://www.google.com/url?sa=i&source=images&cd=&cad=rja&uact=8&ved=2ahUKEwjM-uqRw5XhAhVO7nMBHekDD6sQjRx6BAgBEAU&url=https%3A%2F%2Fwww.bewakoof.com%2Fp%2Fwink-smiley-half-sleeve-t-shirt-for-men&psig=AOvVaw22K2LZLA507-kkerUPcxnR&ust=1553336393495411" ], "subtitle": "new_item", "title": "new_itemn" } }'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,' https://api.ebay.com/sell/inventory/v1/inventory_item/test12'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $headers = array(); $headers[] = 'Authorization: Bearer '.$access_token; $headers[] = 'Content-Language: en-GB'; $headers[] = 'Content-Type: application/json'; $headers[] = 'Content-Length:'.strlen($data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo 'Error:' . curl_error($ch); } print_r(curl_getinfo($ch)); curl_close ($ch); echo "<pre>"; print_r(json_decode($result,true));
inventory apiinventory item group
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
pupo1319 avatar image
0 Likes"
pupo1319 answered
204 no content means that the API does not need to return any content and the call has been executed successfully. You should be able to retrieve the item again using the SKU you assigned.
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.