Class: Peddler::API::AplusContent20201101

Inherits:
Peddler::API show all
Defined in:
lib/peddler/api/aplus_content_2020_11_01.rb

Overview

Selling Partner API for A+ Content Management

With the A+ Content API, you can build applications that help selling partners add rich marketing content to their Amazon product detail pages. A+ content helps selling partners share their brand and product story, which helps buyers make informed purchasing decisions. Selling partners assemble content by choosing from content modules and adding images and text.

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#create_content_document(marketplace_id, post_content_document_request, rate_limit: 10.0) ⇒ Hash

Creates a new A+ Content document.

Parameters:

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • post_content_document_request (Hash)

    The content document request details.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 50

def create_content_document(marketplace_id, post_content_document_request, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments"
  body = post_content_document_request
  params = {
    "marketplaceId" => marketplace_id,
  }.compact

  meter(rate_limit).post(path, body:, params:)
end

#get_content_document(content_reference_key, marketplace_id, included_data_set, rate_limit: 10.0) ⇒ Hash

Returns an A+ Content document, if available.

Parameters:

  • content_reference_key (String)

    The unique reference key for the A+ Content document. A content reference key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match any A+ Content identifier.

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • included_data_set (Array<String>)

    The set of A+ Content data types to include in the response.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



71
72
73
74
75
76
77
78
79
80
81
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 71

def get_content_document(content_reference_key, marketplace_id, included_data_set, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
  params = {
    "marketplaceId" => marketplace_id,
    "includedDataSet" => included_data_set,
  }.compact

  meter(rate_limit).get(path, params:)
end

#list_content_document_asin_relations(content_reference_key, marketplace_id, included_data_set: nil, asin_set: nil, page_token: nil, rate_limit: 10.0) ⇒ Hash

Returns a list of ASINs related to the specified A+ Content document, if available. If you do not include the asinSet parameter, the operation returns all ASINs related to the content document.

Parameters:

  • content_reference_key (String)

    The unique reference key for the A+ Content document. A content reference key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match any A+ Content identifier.

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • included_data_set (Array<String>) (defaults to: nil)

    The set of A+ Content data types to include in the response. If you do not include this parameter, the operation returns the related ASINs without metadata.

  • asin_set (Array<String>) (defaults to: nil)

    The set of ASINs.

  • page_token (String) (defaults to: nil)

    A page token from the nextPageToken response element returned by your previous call to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any other parameter will cause the request to fail. When no nextPageToken value is returned there are no more pages to return. A pageToken value is not usable across different operations.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 122

def list_content_document_asin_relations(content_reference_key, marketplace_id, included_data_set: nil,
  asin_set: nil, page_token: nil, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
  params = {
    "marketplaceId" => marketplace_id,
    "includedDataSet" => included_data_set,
    "asinSet" => asin_set,
    "pageToken" => page_token,
  }.compact

  meter(rate_limit).get(path, params:)
end

#post_content_document_approval_submission(content_reference_key, marketplace_id, rate_limit: 10.0) ⇒ Hash

Submits an A+ Content document for review, approval, and publishing.

Parameters:

  • content_reference_key (String)

    The unique reference key for the A+ Content document. A content reference key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match any A+ content identifier.

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



214
215
216
217
218
219
220
221
222
223
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 214

def post_content_document_approval_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/approvalSubmissions"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact

  meter(rate_limit).post(path, params:)
end

#post_content_document_asin_relations(content_reference_key, marketplace_id, post_content_document_asin_relations_request, rate_limit: 10.0) ⇒ Hash

Replaces all ASINs related to the specified A+ Content document, if available. This may add or remove ASINs, depending on the current set of related ASINs. Removing an ASIN has the side effect of suspending the content document from that ASIN.

Parameters:

  • content_reference_key (String)

    The unique reference key for the A+ Content document. A content reference key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match any A+ content identifier.

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • post_content_document_asin_relations_request (Hash)

    The content document ASIN relations request details.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 148

def post_content_document_asin_relations(content_reference_key, marketplace_id,
  post_content_document_asin_relations_request, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/asins"
  body = post_content_document_asin_relations_request
  params = {
    "marketplaceId" => marketplace_id,
  }.compact

  meter(rate_limit).post(path, body:, params:)
end

#post_content_document_suspend_submission(content_reference_key, marketplace_id, rate_limit: 10.0) ⇒ Hash

Submits a request to suspend visible A+ Content. This neither deletes the content document nor the ASIN relations.

Parameters:

  • content_reference_key (String)

    The unique reference key for the A+ Content document. A content reference key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match any A+ content identifier.

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



234
235
236
237
238
239
240
241
242
243
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 234

def post_content_document_suspend_submission(content_reference_key, marketplace_id, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}/suspendSubmissions"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact

  meter(rate_limit).post(path, params:)
end

#search_content_documents(marketplace_id, page_token: nil, rate_limit: 10.0) ⇒ Hash

Returns a list of all A+ Content documents assigned to a selling partner. This operation returns only the metadata of the A+ Content documents. Call the getContentDocument operation to get the actual contents of the A+ Content documents.

Parameters:

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • page_token (String) (defaults to: nil)

    A page token from the nextPageToken response element returned by your previous call to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any other parameter will cause the request to fail. When no nextPageToken value is returned there are no more pages to return. A pageToken value is not usable across different operations.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 32

def search_content_documents(marketplace_id, page_token: nil, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments"
  params = {
    "marketplaceId" => marketplace_id,
    "pageToken" => page_token,
  }.compact

  meter(rate_limit).get(path, params:)
end

#search_content_publish_records(marketplace_id, asin, page_token: nil, rate_limit: 10.0) ⇒ Hash

Searches for A+ Content publishing records, if available.

Parameters:

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • asin (String)

    The Amazon Standard Identification Number (ASIN).

  • page_token (String) (defaults to: nil)

    A page token from the nextPageToken response element returned by your previous call to this operation. nextPageToken is returned when the results of a call exceed the page size. To get the next page of results, call the operation and include pageToken as the only parameter. Specifying pageToken with any other parameter will cause the request to fail. When no nextPageToken value is returned there are no more pages to return. A pageToken value is not usable across different operations.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 193

def search_content_publish_records(marketplace_id, asin, page_token: nil, rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentPublishRecords"
  params = {
    "marketplaceId" => marketplace_id,
    "asin" => asin,
    "pageToken" => page_token,
  }.compact

  meter(rate_limit).get(path, params:)
end

#update_content_document(content_reference_key, marketplace_id, post_content_document_request, rate_limit: 10.0) ⇒ Hash

Updates an existing A+ Content document.

Parameters:

  • content_reference_key (String)

    The unique reference key for the A+ Content document. A content reference key cannot form a permalink and may change in the future. A content reference key is not guaranteed to match any A+ Content identifier.

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • post_content_document_request (Hash)

    The content document request details.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 92

def update_content_document(content_reference_key, marketplace_id, post_content_document_request,
  rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentDocuments/#{content_reference_key}"
  body = post_content_document_request
  params = {
    "marketplaceId" => marketplace_id,
  }.compact

  meter(rate_limit).post(path, body:, params:)
end

#validate_content_document_asin_relations(marketplace_id, post_content_document_request, asin_set: nil, rate_limit: 10.0) ⇒ Hash

Checks if the A+ Content document is valid for use on a set of ASINs.

Parameters:

  • marketplace_id (String)

    The identifier for the marketplace where the A+ Content is published.

  • asin_set (Array<String>) (defaults to: nil)

    The set of ASINs.

  • post_content_document_request (Hash)

    The content document request details.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:

  • (Hash)

    The API response



168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/peddler/api/aplus_content_2020_11_01.rb', line 168

def validate_content_document_asin_relations(marketplace_id, post_content_document_request, asin_set: nil,
  rate_limit: 10.0)
  cannot_sandbox!

  path = "/aplus/2020-11-01/contentAsinValidations"
  body = post_content_document_request
  params = {
    "marketplaceId" => marketplace_id,
    "asinSet" => asin_set,
  }.compact

  meter(rate_limit).post(path, body:, params:)
end