Class: Peddler::APIs::AplusContent20201101

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

Overview

Selling Partner API for A+ Content Management

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

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #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) ⇒ Peddler::Response

Creates a new A+ Content document.

Parameters:

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • post_content_document_request (Hash)

    The content document request details.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 53

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
  parser = Peddler::Types::AplusContent20201101::PostContentDocumentResponse if typed?
  meter(rate_limit).post(path, body:, params:, parser:)
end

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

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 might change in the future. A content reference key is not guaranteed to match any A+ Content identifier.

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • 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:



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 76

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

  path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}"
  params = {
    "marketplaceId" => marketplace_id,
    "includedDataSet" => stringify_array(included_data_set),
  }.compact
  parser = Peddler::Types::AplusContent20201101::GetContentDocumentResponse if typed?
  meter(rate_limit).get(path, params:, parser:)
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) ⇒ Peddler::Response

Returns a list of ASINs that are related to the specified A+ Content document, if available. If you don’t include the ‘asinSet` parameter, this 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 might change in the future. A content reference key is not guaranteed to match any A+ Content identifier.

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

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

    The set of A+ Content data types to include in the response. If you don’t 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 token that you use to fetch a specific page when there are multiple pages of results.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 128

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/#{percent_encode(content_reference_key)}/asins"
  params = {
    "marketplaceId" => marketplace_id,
    "includedDataSet" => stringify_array(included_data_set),
    "asinSet" => stringify_array(asin_set),
    "pageToken" => page_token,
  }.compact
  parser = Peddler::Types::AplusContent20201101::ListContentDocumentAsinRelationsResponse if typed?
  meter(rate_limit).get(path, params:, parser:)
end

#post_content_document_approval_submission(content_reference_key, marketplace_id, rate_limit: 10.0) ⇒ Peddler::Response

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 might change in the future. A content reference key is not guaranteed to match any A+ content identifier.

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



227
228
229
230
231
232
233
234
235
236
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 227

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

  path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}/approvalSubmissions"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact
  parser = Peddler::Types::AplusContent20201101::PostContentDocumentApprovalSubmissionResponse if typed?
  meter(rate_limit).post(path, params:, parser:)
end

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

Replaces all ASINs related to the specified A+ Content document, if available. This operation can add or remove ASINs, depending on the current set of related ASINs. Removing an ASIN will suspend 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 might change in the future. A content reference key is not guaranteed to match any A+ content identifier.

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • post_content_document_asin_relations_request (Hash)

    The request details for the content document ASIN relations.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 157

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/#{percent_encode(content_reference_key)}/asins"
  body = post_content_document_asin_relations_request
  params = {
    "marketplaceId" => marketplace_id,
  }.compact
  parser = Peddler::Types::AplusContent20201101::PostContentDocumentAsinRelationsResponse if typed?
  meter(rate_limit).post(path, body:, params:, parser:)
end

#post_content_document_suspend_submission(content_reference_key, marketplace_id, rate_limit: 10.0) ⇒ Peddler::Response

Submits a request to suspend visible A+ Content. This doesn’t delete the content document or 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 might change in the future. A content reference key is not guaranteed to match any A+ content identifier.

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



248
249
250
251
252
253
254
255
256
257
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 248

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

  path = "/aplus/2020-11-01/contentDocuments/#{percent_encode(content_reference_key)}/suspendSubmissions"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact
  parser = Peddler::Types::AplusContent20201101::PostContentDocumentSuspendSubmissionResponse if typed?
  meter(rate_limit).post(path, params:, parser:)
end

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

Returns a list of all A+ Content documents, including metadata, that are assigned to a selling partner. To get the actual contents of the A+ Content documents, call the ‘getContentDocument` operation.

Parameters:

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • page_token (String) (defaults to: nil)

    A token that you use to fetch a specific page when there are multiple pages of results.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



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

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
  parser = Peddler::Types::AplusContent20201101::SearchContentDocumentsResponse if typed?
  meter(rate_limit).get(path, params:, parser:)
end

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

Searches for A+ Content publishing records, if available.

Parameters:

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • asin (String)

    The Amazon Standard Identification Number (ASIN) is the unique identifier of a product within a marketplace.

  • page_token (String) (defaults to: nil)

    A token that you use to fetch a specific page when there are multiple pages of results.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 204

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
  parser = Peddler::Types::AplusContent20201101::SearchContentPublishRecordsResponse if typed?
  meter(rate_limit).get(path, params:, parser:)
end

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

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 might change in the future. A content reference key is not guaranteed to match any A+ Content identifier.

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • post_content_document_request (Hash)

    The content document request details.

  • rate_limit (Float) (defaults to: 10.0)

    Requests per second

Returns:



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 99

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/#{percent_encode(content_reference_key)}"
  body = post_content_document_request
  params = {
    "marketplaceId" => marketplace_id,
  }.compact
  parser = Peddler::Types::AplusContent20201101::PostContentDocumentResponse if typed?
  meter(rate_limit).post(path, body:, params:, parser:)
end

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

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

Parameters:

  • marketplace_id (String)

    The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](developer-docs.amazon.com/sp-api/docs/marketplace-ids).

  • 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:



179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/peddler/apis/aplus_content_2020_11_01.rb', line 179

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" => stringify_array(asin_set),
  }.compact
  parser = Peddler::Types::AplusContent20201101::ValidateContentDocumentAsinRelationsResponse if typed?
  meter(rate_limit).post(path, body:, params:, parser:)
end