uploads-api-model

AmzSpApi::UploadsApiModel - the Ruby gem for the Selling Partner API for Uploads

The Selling Partner API for Uploads provides operations that support uploading files.

This SDK is automatically generated by the Swagger Codegen project:

Installation

Build a gem

To build the Ruby code into a gem:

gem build uploads-api-model.gemspec

Then either install the gem locally:

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

(for development, run gem install --dev ./uploads-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 'uploads-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 'uploads-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 'uploads-api-model'

api_instance = AmzSpApi::UploadsApiModel::UploadsApi.new
marketplace_ids = ['marketplace_ids_example'] # Array<String> | A list of marketplace identifiers. This specifies the marketplaces where the upload will be available. Only one marketplace can be specified.
content_md5 = 'content_md5_example' # String | An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit.
resource = 'resource_example' # String | The URL of the resource for the upload destination that you are creating. For example, to create an upload destination for a Buyer-Seller Messaging message, the {resource} would be /messaging and the path would be  /uploads/v1/uploadDestinations/messaging
opts = { 
  content_type: 'content_type_example' # String | The content type of the file to be uploaded.
}

begin
  result = api_instance.create_upload_destination_for_resource(marketplace_ids, content_md5, resource, opts)
  p result
rescue AmzSpApi::UploadsApiModel::ApiError => e
  puts "Exception when calling UploadsApi->create_upload_destination_for_resource: #{e}"
end

Documentation for API Endpoints

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

Class | Method | HTTP request | Description ———— | ————- | ————- | ————- AmzSpApi::UploadsApiModel::UploadsApi | {create_upload_destination_for_resource} | POST /uploads/2020-11-01/uploadDestinations/{resource} |

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.