Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
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!
Solved! Go to the solution
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.
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.
User | RANK |
---|---|
4 | |
4 | |
4 | |
3 | |
3 |