I have tried to utilize the React HubSpot components and retrieve data from “product_collections” via GraphQL but it throws an error that I don’t have the right scope assigned. I am able to query (via GraphQL) Contacts just fine. The issue, as I see it, is that the “Personal Access Key” does not expose the “e-commerce” scope. When I use the “e-commerce” scope in a Private App, I am able to access “product_collections” fine. So, it seems to me, that it is a restriction of the “Personal Access Key” and I am not sure how to get around this issue. I would like to use GraphQL to access “product_collections” but I might have to revert back to HubL for pulling the data in and then passing it to the React Component. Thanks for thoughts.
Hi there,
I do have a question , since personal access keys are directly linked to your portal permissions , have you verified you have the correct permissions at a user level?
Alternatively , I would suggest two approaches;
1. Exclusively use a Private app , which may require a rework.
2. Hybrid approach - Use Private App credentials for GraphQL queries involving “product_collections” only,
I hope this helps.
You’re correct in identifying that Personal Access Tokens in HubSpot don’t support the “e-commerce” scope needed to access “product_collections”. Since you can access this data with a Private App, the simplest solution is to continue using Private Apps for these queries. This approach will allow you to maintain the necessary permissions without needing to switch back to HubL, which wouldn’t resolve the scope limitation of the Personal Access Token. If further assistance is needed, consider reaching out to HubSpot’s developer support.
Thanks for the prompt feedback and confirming e-commerce is not available. The issue then will be how to consume a Private App using the hubspot.config.yml file. I have not yet seen any info on this, though likely it is a possibility. Do you know of any documentation / have any examples in this regard?
For anyone else who stumbles on this, you are able to modify your hubspot.config.yml file to work with a private app. Here are the changes I had to make:
- portalId: {your portal Id found in URL}
- authType: oauth2
- auth:
- clientId: {your private app Id from URL}
- clientSecret: {your private app ‘Client secret’}
- tokenInfo:
- accessToken: {your private app ‘Access token’}
- expiresAt: {any date in the future will work}
- refreshToken: anything (literally type any word here, just needs value)
- accountType: {STANDARD or STANDARD_SANDBOX}
- parentAccountId: {if STANDARD_SANDBOX use parent portal Id}
Hope this is helpful.