AdminAPI/REST Reference - Basic authentication does not work when creating a new Smart Collection

Solved
pmd85
Tourist
17 0 1

https://shopify.dev/docs/admin-api/rest/reference/products/smartcollection#create-2021-04

If I try to create new Smart Collection using Postman I'll get response below. Same for prepending username:password@ to the hostname in the URL or for the credentials in the Authorization header. I'm using the Authorization header and I haven't had a problem with that yet.

It only works if I use  X-Shopify-Access-Token request header. 

<html>
<body>
<noscript>
<a
</noscript>
<script type="text/javascript" defer>
window.location = "https:\/\/accounts.shopify.com\/oauth\/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c\u0026destination_uuid=1cd5ad27-a39c-456a-a22d-90eda1771ae7\u0026nonce=60d36421b61793fa03fff9ca8d115dc9\u0026prompt=merge\u0026redirect_uri=https%3A%2F%2Fmule99.myshopify.com%2Fadmin%2Fauth%2Fidentity%2Fcallback\u0026response_type=code\u0026scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshopify-chat.admin.graphql%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fflow.workflows.manage\u0026state=e8f1a0e2a27a6b4d55738582dd31d436\u0026ui_locales=en\u0026ux=shop%20new_design_language";
</script>
</body>
</html>

 

Thanks

 

0 Likes
Jason
Shopify Expert
10350 154 1986

This is an accepted solution.

I'd guess you're sending cookies in the request. If you're using the web version of postman you can not control that but the desktop version will let you delete them. It will work then but post back here if it doesn't. The block is intentional and for good security.

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
pmd85
Tourist
17 0 1

Thanks Jason.

I enabled(turn on)  Disable cookie jar parameter in Postman settings and now it works.

Interestingly, all the operations I tested worked without it.

0 Likes