Unable to create smart collection, get a html page back instead

Solved
New Member
1 0 0

Hi, I keep getting an html page back with a status 200 when trying to add a smart collection via the api. What am i doing wrong? The Admin API permission I have set are "Product listings", "Products", read and write.

sending a POST request to .... /admin/api/2020-10/smart_collections.json

With JSON:

 

{
"smart_collections": {
"title": "Test",
"rules": [
{
"column": "type",
"relation": "equals",
"condition": "Test"
}
]
}
}

 

 

I get this html page back (been trimmed down):

<html>

<body>
<noscript>
<a
href="https://accounts.shopify.com/oauth/authorize?client_id=...

</noscript>

    <script type="text/javascript" defer>
        window.location = "https:\/\/accounts.shopify.com\/oauth\/authorize?......

</script>
</body>

</html>

 
0 Likes
Shopify Partner
856 73 185

This is an accepted solution.

If you are using Postman or a similar tool for your API request, then you need to disable sending any client-side cookies. This is a known quirk that I always forget about from time to time...