AdobeDocs / AdobeDocs/commerce-services
Product Recommendations SDK returns 403 error
- Dominant language
- JavaScript
- Stars
- 5
- Forks
- 26
- Avg merge
- 3h 28m
- Merged PRs (30d)
- 1
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Expected behavior
it should return product data
### Actual behavior
Whenever I use the Product Recommendations SDK ping method, it shows a 403 error. I searched multiple documents; there is no reference to adding any other key or credentials-related information.
response : {
"status": 403,
"data": "{ \"error\": { \"code\": \"Forbidden\", \"message\": \"Client ID is missing\", \"details\": { \"error_code\": \"403000\" } } }\n"
}

### Steps to reproduce

### Environment
- Browser: Crome
- OS: linux
### Sample code
const client = new RecommendationsClient({
environmentId: "e0d84de8-2c34-4fa1-9f2f-8c3dda755dbb",
websiteCode: "base",
storeViewCode: "default",
storeCode: "main_website_store",
instanceId: "7d5096bd21e34459b47555f59f925401",
});
// Register pre-built recommendation unit
client.register({
name: "trending",
type: "trending",
// filters: "categories: (disposable)",
});
// Retrieve recommendations for all units
client.ping().then((e) => {
debugger;
/* response : { "status": 403, "data": "{ \"error\": { \"code\": \"Forbidden\", \"message\": \"Client ID is missing\",\"details\": { \"error_code\": \"403000\" } } }\n" */
}
});
### Logs
response : {
"status": 403,
"data": "{ \"error\": { \"code\": \"Forbidden\", \"message\": \"Client ID is missing\", \"details\": { \"error_code\": \"403000\" } } }\n"
}
Contributor guide
Research direction
Start with the supplied RecommendationsClient constructor and ping() call, then trace the request requirements for the Product Recommendations SDK. Compare the documented setup with the 403 response and determine whether the missing Client ID requires a documentation update or an SDK change; done means the cause and expected credential setup are verified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100