Solved

SHOPIFY API POST requests do not work with POSTMAN on Private Apps

Eyal_A770
Shopify Partner
2 0 1

Hi All,

I'm trying to make a very basic POST request for a private app.

I am working with postman EXACTLY as described here:

https://help.shopify.com/api/tutorials/using-postman

Unfortunately, It is not working. It returns status 200 and return an html page that says : "Log in to manage your store"...

Needles to say, it does not apply any changes to the shop.

For some reason, GET requests work fine while all POST requests fail.

Does anyone have a clue?

 

Accepted Solution (1)

Jason
Shopify Expert
11190 225 2282

This is an accepted solution.

Are you sending cookies in the request?

Remove those and you should start to see better results. If you can't do this consider using the X-Shopify-Access-Token method as described here:
https://help.shopify.com/api/getting-started/authentication/oauth#step-4-making-authenticated-reques...

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★

View solution in original post

Replies 9 (9)

Jason
Shopify Expert
11190 225 2282

This is an accepted solution.

Are you sending cookies in the request?

Remove those and you should start to see better results. If you can't do this consider using the X-Shopify-Access-Token method as described here:
https://help.shopify.com/api/getting-started/authentication/oauth#step-4-making-authenticated-reques...

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
RogerC
Shopify Partner
4 0 6

Thank again Jason!! This took me a little to find and fix!


@Jason wrote:

Are you sending cookies in the request?

Remove those and you should start to see better results. If you can't do this consider using the X-Shopify-Access-Token method as described here:
https://help.shopify.com/api/getting-started/authentication/oauth#step-4-making-authenticated-reques...


 

begyourpardon
Visitor
3 0 0

Removing the cookies from Postman fixed my strange issue of getting the Shopify login screen returned in HTML instead of the JSON response when creating a new customer. Thanks for the tip Jason! Not sure what causes those cookies, but at least i have a fix.

Mark_Johnson3
Shopify Partner
4 0 6

Thanks, Jason! That was helpful.

For anyone else who comes across this issue, you can find the option to edit cookies below the "Send" button. Removing all of them by clicking the "x" allowed me to make post requests successfully.

Lux-Capacitor
Tourist
7 0 6

This should be pinned to the top of the API section. POSTMAN is a terrible API development tool - the chrome app version doesn't even let you get rid of the cookies. Migrated my calls to PAW and it worked flawlessly without extra added cookie junk. 

Thank you for this post!

- Lux.

friendoftheroot
Shopify Partner
45 4 7

The desktop version however allows to do this, and makes it very easy. There is a link below the Send button. It shows you all the cookies.

Preethi
Visitor
3 0 0

I have tried "X-Shopify-Access-Token" token with my ajax request. Still cookies are enabled. I am making ajax request from shopify template.

Ruby_Lauruss12
Visitor
1 0 0

Screenshot 2019-06-24 at 2.41.24 PM.pngScreenshot 2019-06-24 at 2.44.13 PM.png

I use Private App. When I usedX-Shopify-Access-Token get response like screenshot. When I used Basic Authorization get HTML Response. Please help me.



AustinHutchison
Shopify Expert
52 1 18

Was running into this issue and found that I needed to download the latest version of the Postman **NATIVE** app to get this to work. Triple check you're using the native app, because I thought I was and it was actually a desktop launcher for a chrome extension.