messaging-api-model

AmzSpApi::MessagingApiModel - the Ruby gem for the Selling Partner API for Messaging

With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the <a href=Swagger Codegen project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build messaging-api-model.gemspec

Then either install the gem locally:

gem install ./messaging-api-model-0.1.0.gem

(for development, run gem install --dev ./messaging-api-model-0.1.0.gem to install the development dependencies)

or publish the gem to a gem hosting service, e.g. RubyGems.

Finally add this to the Gemfile:

gem 'messaging-api-model', '~> 0.1.0'

Install from Git

If the Ruby gem is hosted at a git repository: github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:

gem 'messaging-api-model', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'

Include the Ruby code directly

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

Please follow the installation procedure and then run the following code:

# Load the gem
require 'messaging-api-model'

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateConfirmCustomizationDetailsRequest.new # CreateConfirmCustomizationDetailsRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.confirm_customization_details(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->confirm_customization_details: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateAmazonMotorsRequest.new # CreateAmazonMotorsRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_amazon_motors(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_amazon_motors: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateConfirmDeliveryDetailsRequest.new # CreateConfirmDeliveryDetailsRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_confirm_delivery_details(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_confirm_delivery_details: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateConfirmOrderDetailsRequest.new # CreateConfirmOrderDetailsRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_confirm_order_details(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_confirm_order_details: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateConfirmServiceDetailsRequest.new # CreateConfirmServiceDetailsRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_confirm_service_details(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_confirm_service_details: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateDigitalAccessKeyRequest.new # CreateDigitalAccessKeyRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_digital_access_key(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_digital_access_key: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateLegalDisclosureRequest.new # CreateLegalDisclosureRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_legal_disclosure(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_legal_disclosure: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_negative_feedback_removal(amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_negative_feedback_removal: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateUnexpectedProblemRequest.new # CreateUnexpectedProblemRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_unexpected_problem(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_unexpected_problem: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
body = AmzSpApi::MessagingApiModel::CreateWarrantyRequest.new # CreateWarrantyRequest |
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.create_warranty(body, amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->create_warranty: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which a message is sent.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.get_attributes(amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->get_attributes: #{e}"
end

api_instance = AmzSpApi::MessagingApiModel::MessagingApi.new
amazon_order_id = 'amazon_order_id_example' # String | An Amazon order identifier. This specifies the order for which you want a list of available message types.
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified.


begin
  result = api_instance.get_messaging_actions_for_order(amazon_order_id, marketplace_ids)
  p result
rescue AmzSpApi::MessagingApiModel::ApiError => e
  puts "Exception when calling MessagingApi->get_messaging_actions_for_order: #{e}"
end

Documentation for API Endpoints

All URIs are relative to https://sellingpartnerapi-na.amazon.com/

Class | Method | HTTP request | Description ———— | ————- | ————- | ————- AmzSpApi::MessagingApiModel::MessagingApi | {confirm_customization_details} | POST /messaging/v1/orders/{amazonOrderId}/messages/confirmCustomizationDetails | AmzSpApi::MessagingApiModel::MessagingApi | {create_amazon_motors} | POST /messaging/v1/orders/{amazonOrderId}/messages/amazonMotors | AmzSpApi::MessagingApiModel::MessagingApi | {create_confirm_delivery_details} | POST /messaging/v1/orders/{amazonOrderId}/messages/confirmDeliveryDetails | AmzSpApi::MessagingApiModel::MessagingApi | {create_confirm_order_details} | POST /messaging/v1/orders/{amazonOrderId}/messages/confirmOrderDetails | AmzSpApi::MessagingApiModel::MessagingApi | {create_confirm_service_details} | POST /messaging/v1/orders/{amazonOrderId}/messages/confirmServiceDetails | AmzSpApi::MessagingApiModel::MessagingApi | {create_digital_access_key} | POST /messaging/v1/orders/{amazonOrderId}/messages/digitalAccessKey | AmzSpApi::MessagingApiModel::MessagingApi | {create_legal_disclosure} | POST /messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure | AmzSpApi::MessagingApiModel::MessagingApi | {create_negative_feedback_removal} | POST /messaging/v1/orders/{amazonOrderId}/messages/negativeFeedbackRemoval | AmzSpApi::MessagingApiModel::MessagingApi | {create_unexpected_problem} | POST /messaging/v1/orders/{amazonOrderId}/messages/unexpectedProblem | AmzSpApi::MessagingApiModel::MessagingApi | {create_warranty} | POST /messaging/v1/orders/{amazonOrderId}/messages/warranty | AmzSpApi::MessagingApiModel::MessagingApi | {get_attributes} | GET /messaging/v1/orders/{amazonOrderId}/attributes | AmzSpApi::MessagingApiModel::MessagingApi | {get_messaging_actions_for_order} | GET /messaging/v1/orders/{amazonOrderId} |

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.