Class: MWS::Recommendations

Inherits:
Peddler::Client show all
Defined in:
lib/mws/recommendations.rb

Overview

The Recommendations API enables you to programmatically retrieve Amazon Selling Coach recommendations by recommendation category. A recommendation is an actionable, timely, and personalized opportunity to increase your sales and performance.

Constant Summary

Constants inherited from Peddler::Client

Peddler::Client::BadMarketplaceId, Peddler::Client::HOSTS

Instance Attribute Summary

Attributes inherited from Peddler::Client

#body, #marketplace_id, #merchant_id

Instance Method Summary collapse

Methods inherited from Peddler::Client

#aws_endpoint, #headers, inherited, #operation, path, #run

Instance Method Details

#get_last_updated_time_for_recommendations(marketplace_id = marketplace_id) ⇒ Peddler::XMLParser

Checks whether there are active recommendations for each category for the given marketplace, and if there are, returns the time when recommendations were last updated for each category



18
19
20
21
22
23
# File 'lib/mws/recommendations.rb', line 18

def get_last_updated_time_for_recommendations(marketplace_id = marketplace_id)
  operation('GetLastUpdatedTimeForRecommendations')
    .add('MarketplaceId' => marketplace_id)

  run
end

#get_service_statusPeddler::XMLParser

Gets the service status of the API



61
62
63
64
# File 'lib/mws/recommendations.rb', line 61

def get_service_status
  operation('GetServiceStatus')
  run
end

#list_recommendations(opts = { marketplace_id: marketplace_id }) ⇒ Peddler::XMLParser

Lists active recommendations for a specific category or for all categories for a specific marketplace

Parameters:

  • opts (Hash) (defaults to: { marketplace_id: marketplace_id })

Options Hash (opts):

  • :marketplace_id (String)
  • :recommendation_category (String)
  • :category_query_list (String)

Returns:

See Also:



35
36
37
38
39
40
41
42
43
# File 'lib/mws/recommendations.rb', line 35

def list_recommendations(opts = {})
  opts[:marketplace_id] ||= marketplace_id

  operation('ListRecommendations')
    .add(opts)
    .structure!('CategoryQueryList', 'CategoryQuery', '1', 'FilterOptions', 'FilterOption')

  run
end

#list_recommendations_by_next_token(next_token) ⇒ Peddler::XMLParser

Lists the next page of active recommendations



50
51
52
53
54
55
# File 'lib/mws/recommendations.rb', line 50

def list_recommendations_by_next_token(next_token)
  operation('ListRecommendationsByNextToken')
    .add('NextToken' => next_token)

  run
end