Hi all.
When running a shopifyqlQuery we get the following error:
Access denied for shopifyqlQuery field. Required access: `read_reports` access scope. Also: Level 2 access to Customer data including name, address, phone, and email fields. Please refer to protected customer data [requirements](https://shopify.dev/docs/apps/launch/protected-customer-data).
We run the sample query from the dev docs: https://shopify.dev/docs/api/admin-graphql/latest/queries/shopifyqlQuery
- The dev store is in Grow plan (Not basic plan)
- We do have “read_reports” scope on our app
- Our app is public, approved, and we also have access to Address field level 2 customer level data. We only requested address because we don’t need the rest, and got approved.
We tried pushing a new app version and completely uninstalling and reinstalling the app on our dev store, but to no avail.
Any idea what we’re missing?
Thanks all.
Maybe I am wrong ,you could try
I assume that the data for other Level 2 customer tiers also needs to have values set.
So request access to all level 2 customer data fields?
I think this should be the last resort, not sure whether needing it for GraphQL is a strong enough argument.
According to the AI assistant this shouldn’t be an issue, but it might be wrong…
Hi @David_Incrmntal,
If you’ve added the read_reports after the app was initially installed, the merchant would need to approve the scope changes by accessing the app in their admin before you’re able to use the newly added scope.
You can confirm if you have access to a scope with the appInstallation.accessScopes query.
If you do have the read_reports scope returned in the query on the shop in question, and you’ve requested Level 2 access to Customer data including name, address, phone, and email fields, which is required to use the ShopifyqlQuery api call, and the error is still returning, please provide us with the x-request-id from the call returning the error message and we can help look into this further.
Got the other fields approved, and now it works.
Bottom line:
Access to ALL level 2 customer data fields is required for GraphQL queries to work, even if said fields aren’t part of a query.
Also the AI assistant currently gives wrong answers about this, as it said that not all fields are required.
Thanks everyone!
1 Like