Getting Bad Request With Admin API.

APInifynMYApp
Shopify Partner
1 0 0

Hi All!

I'm successfully performing a GET of all products via the Admin API. But when I try to create a product, I keep getting BAD REQUEST... and I don't know why. What am I missing? 

Here's what I'm trying:

JSON

{"product":{"body_html":"<strong>Good snowboard!</strong>","product_type":"Snowboard","status":"draft","title":"Burton Custom Freestyle 151","vendor":"Burton"}}

 

HEADER

 -H "Method: POST" -H "Content-Type: application/json" -H "X-Shopify-Access-Token: REMOVEDFORSECURITY"

 

URL

https://REMOVEDFORSECURITY.myshopify.com/admin/api/2024-01/products.json

 

cURL Sent:

 -H "Method: POST" -H "Content-Type: application/json" -H "X-Shopify-Access-Token: REMOVEDFORSECURITY" -d {"product":{"body_html":"B<strong>Good snowboard!</strong>","product_type":"Snowboard","status":"draft","title":"Burton Custom Freestyle 151","vendor":"Burton"}} -D $responseHeader

 

Response:

Bad Request

Reply 1 (1)

jmitchtx
Visitor
1 0 0

Make sure your JSON is well-formed and escaped, see this stackoverflow article for more info.