API call logs for products.json POST problem

Solved
AcousticEagle
New Member
2 1 0

I am looking a solution for my API call problems.  Also, is there a place where I can see (from the shopify.com api server side) who is calling my api with my SECRET:STUFF?  

I am trying to make the following call:

POST https://SECRET:STUFF@hometownhoodies.myshopify.com/admin/api/2021-07/products.json 

With the following body (largely copied from shopify product api docs):

{
"product": {
"title": "Mens Hoodie - Alaska - Up North!",
"body_html": "<div id=1>Mens Hoodie - Alaska - Up North</div>",
"vendor": "Hometown Hoodies",
"product_type": "Hoodie",
"published": "false",
"status": "DRAFT"
}
}

My RESULT:

400 Bad Request

 

Does anyone have any advice?

Thanks!

Accepted Solution (1)

Accepted Solutions
AcousticEagle
New Member
2 1 0

This is an accepted solution.

My call required an explicit JSON content type in my headers

$Header = @{
"Authorization" = "Basic $base64AuthInfo"
"Content-Type" = "application/json"
}

Doing so solved my response code 400!  Yeah.

Now my call returns:

The remote server returned an error: (422) Unprocessable Entity.  Guessing I must have something off in my body now.  

View solution in original post

Reply 1 (1)
AcousticEagle
New Member
2 1 0

This is an accepted solution.

My call required an explicit JSON content type in my headers

$Header = @{
"Authorization" = "Basic $base64AuthInfo"
"Content-Type" = "application/json"
}

Doing so solved my response code 400!  Yeah.

Now my call returns:

The remote server returned an error: (422) Unprocessable Entity.  Guessing I must have something off in my body now.