- Newest
- Most votes
- Most comments
Hello,
Could please update the scope to sellingpartnerapi::catalog and try again?
const tokenResponse = await axios.post('https://<api>/auth/o2/token', {
grant_type: 'client_credentials',
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET,
scope: 'sellingpartnerapi::catalog' // Correct scope for catalog access
}),
console.log('Access Token:', accessToken);
const response = await axios.get(`https://<url>/products/v0/catalogs/categories/${categoryId}/keywords`, {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json'
},
params: {
marketplace_id: process.env.MARKETPLACE_ID
}
});
IAM policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"execute-api:Invoke"
],
"Resource": "arn:aws:execute-api:*:*:*"
},
{
"Effect": "Allow",
"Action": [
"sts:AssumeRole"
],
"Resource": "arn:aws:iam::YOUR_AWS_ACCOUNT_ID:role/YOUR_SPAPI_ROLE_NAME"
}
]
}
I would be happy to assist you further!
Hi Sivaraman, Thanks for your response. I did try that scope and a host of others but they all throw the same error. So far I've tried the following scopes and encountered the same error.
- sellingpartnerapi:GetCatalogItems
- sellingpartnerapi:ListCatalogItems
- sellingpartnerapi:SearchCatalogItems
- sellingpartnerapi:ListMarketplaceParticipations
- sellingpartnerapi:GetMarketplaceParticipations**
- sellingpartnerapi::catalog
- sellingpartnerapi::catalog_data
Could there be an issue with the way my app is registered? Are there specific configurations or roles that must be set during app registration for these scopes to work?
Am I using the correct endpoint for the Selling Partner API based on my region? My current endpoint is https://sellingpartnerapi-na. Amzn url. Is there any other configuration needed for this endpoint?
Are there specific IAM policies or roles that need to be configured to allow access to these scopes? Here is the IAM policy I'm stalled at this moment. I spent the last hour reading AWS API documentation and troubleshooting but with no success so far.
Relevant content
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago