I am integrating Amazon Product Api in my rails app. The only thing remaining now is fetching related items list when I am performing the item_lookup
operation.
When I add RelatedItems
in ResponseGroup like this:
response = request.item_lookup(
query: {
'ItemId' => params[:id],
'ResponseGroup' => "ItemAttributes,Images,Reviews,RelatedItems"
}
)
I get this error:
"Errors"=>{"Error"=>{"Code"=>"AWS.MissingParameterValueCombination", "Message"=>"Your request is missing a required parameter combination. When ResponseGroup equals RelatedItems, RelationshipType must be present."}}}
It seems that I need to add RelationshipType
in my query.
The issue is I have my categories being saved in the backend. The search_index
and keyword
is passed to the item_search
operation where I fetch the ASIN
which I pass as param to item_lookup
operation. The issue is how can I add RelationshipType over here and also that it has to dynamic as per the product being displayed.
Thanks in advance.