Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Authentication HTML page Response on GraphQL

Solved

Authentication HTML page Response on GraphQL

phyllistlt
Shopify Partner
9 1 1

Hello everyone,

 

I am trying on using graphql with postman but I got the 200 ok status with html page response and the link given is the authentication page. 

For some background, I am using the access token generated from the shopify admin and the token is usable when I call the request using restful API.

phyllistlt_0-1703147069405.png

 

If anyone has experienced the same problem or has a solution, I would appreciate it.

Thanks a lot

Accepted Solution (1)
phyllistlt
Shopify Partner
9 1 1

This is an accepted solution.

Hi Ocastx,

 

Finally resolved the problem. The issue occur since I have set the authorization as basic auth. It will require Inherit auth from parent type for graphql

 

Thanks for your help

View solution in original post

Replies 6 (6)

ocastx
Shopify Partner
31 6 12

Hi PhyllstIt,

 

a few things I see from the screenshot: 

 

1. You are using an old API version (2022-04). Consider upgrading to a newer one, like 2023-10 to avoid runing into any stability issues.

2. Is the ShopName variable in the URL containing a valid shop name? The red background indicates that Postman does not have a value there as far as I can see. Try either adding the variable value or by replacing it with your shop name for testing.

3. Could you share which GraphQL query or mutation you are trying to send? It would be helpful to debug the issue further.

 

Let me know!

phyllistlt
Shopify Partner
9 1 1

Hi Ocastx,

 

Thanks for replying.

1) I have tried on both 2022-04 and 2023-10 but I got the same result.

2) I have use the valid shop name. In the  screencap, I have hide the shop name I use and replace with the variable.

3)  This is using the graphql type in the body

{
  shop {
    name
  }
}
 
thanks a lot
ocastx
Shopify Partner
31 6 12

Hi PhyllistIt,

 

thanks for the info! 

I was able to reproduce the issue with the parameters you provided, by modifying the path after {{ShopName}}.myshopify.com to an invalid string.

 

For example, an extra whitespace after graphql.json got me the authentication page reply as well. As soon as I removed it, the API responded nominally.

 

Can you check if the path in Postman is indeed correct and does not contain hidden characters? Try by replacing it with this path which I just validated: 

 

https://{{ShopName}}.myshopify.com/admin/api/2022-04/graphql.json

 

Hope this helps!

phyllistlt
Shopify Partner
9 1 1

Hi Ocastx,

 

I have tried with the link given above but still not working. I have also checked on all possible place that invalid character can be appear and no invalid character being found.

phyllistlt
Shopify Partner
9 1 1

This is an accepted solution.

Hi Ocastx,

 

Finally resolved the problem. The issue occur since I have set the authorization as basic auth. It will require Inherit auth from parent type for graphql

 

Thanks for your help

ocastx
Shopify Partner
31 6 12

Glad to hear PhyllistIt!