POST Article not posting, returning 200 instead

Solved

POST Article not posting, returning 200 instead

david337
Tourist
9 1 0

Making a POST request to https://name.myshopify.com/admin/api/2023-10/blogs/id/articles.json with the API token and correct body(the one used in Article (shopify.dev)) seems to be returning a 200 with the articles currently present, instead of creating a new article. Even removing the body entirely leads to the same result. It's almost as if this was replaced by the GET request. Same result on different versions

Accepted Solution (1)
david337
Tourist
9 1 0

This is an accepted solution.

Issue fixed. You need to use the original URL shopify gives you (numbers and letters).myshopify.com
Found it out of pure luck, as no dev was bothered to help me and support told me to pay for a specialist. Absolute disgrace

View solution in original post

Replies 5 (5)

SBD_
Shopify Staff
1831 273 418

Yeah that does sound like a GET request 🤔

 

How are you sending the request? Have you tried cURL? 

curl -d '{"article":{"title":"My new Article title","author":"John Smith","tags":"This Post, Has Been Tagged","body_html":"<h1>I like articles</h1>\n<p><strong>Yea</strong>, I like posting them through <span class=\"caps\">REST</span>.</p>","published_at":"Thu Mar 24 15:45:47 UTC 2011"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2023-10/blogs/241253187/articles.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"




Scott | Developer Advocate @ Shopify 

david337
Tourist
9 1 0

Hi there. Thank you for the answer

Using curl seems to lead to a 301 for some reason, without actually creating the article. I had previously used nodejs and insomnia but both led to the same result, the 200

david337
Tourist
9 1 0

Same thing seems to be hapenning with the create product? These endpoints are just returning what's already available on the website instead of actually uploading the data.

david337_1-1708039468639.png

 

 

david337
Tourist
9 1 0

This is an accepted solution.

Issue fixed. You need to use the original URL shopify gives you (numbers and letters).myshopify.com
Found it out of pure luck, as no dev was bothered to help me and support told me to pay for a specialist. Absolute disgrace

SBD_
Shopify Staff
1831 273 418

Sorry for the delay and glad you got it sorted. It looks like you were using myshopify.com domain in the screenshots - had you changed the myshopify URL, or were you using a custom domain?

Scott | Developer Advocate @ Shopify