reports-api-model¶ ↑
AmzSpApi::ReportsApiModel
- the Ruby gem for the Selling Partner API for Reports
The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
This SDK is automatically generated by the Swagger Codegen project:
-
API version: 2020-09-04
-
Package version: 0.1.0
-
Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen For more information, please visit sellercentral.amazon.com/gp/mws/contactus.html
Installation¶ ↑
Build a gem¶ ↑
To build the Ruby code into a gem:
gem build reports-api-model.gemspec
Then either install the gem locally:
gem install ./reports-api-model-0.1.0.gem
(for development, run gem install --dev ./reports-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 'reports-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 'reports-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 'reports-api-model' api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new report_id = 'report_id_example' # String | The identifier for the report. This identifier is unique only in combination with a seller ID. begin result = api_instance.cancel_report(report_id) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->cancel_report: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new report_schedule_id = 'report_schedule_id_example' # String | The identifier for the report schedule. This identifier is unique only in combination with a seller ID. begin result = api_instance.cancel_report_schedule(report_schedule_id) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->cancel_report_schedule: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new body = AmzSpApi::ReportsApiModel::CreateReportSpecification.new # CreateReportSpecification | begin result = api_instance.create_report(body) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->create_report: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new body = AmzSpApi::ReportsApiModel::CreateReportScheduleSpecification.new # CreateReportScheduleSpecification | begin result = api_instance.create_report_schedule(body) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->create_report_schedule: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new report_id = 'report_id_example' # String | The identifier for the report. This identifier is unique only in combination with a seller ID. begin result = api_instance.get_report(report_id) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->get_report: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new report_document_id = 'report_document_id_example' # String | The identifier for the report document. begin result = api_instance.get_report_document(report_document_id) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->get_report_document: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new report_schedule_id = 'report_schedule_id_example' # String | The identifier for the report schedule. This identifier is unique only in combination with a seller ID. begin result = api_instance.get_report_schedule(report_schedule_id) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->get_report_schedule: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new report_types = ['report_types_example'] # Array<String> | A list of report types used to filter report schedules. begin result = api_instance.get_report_schedules(report_types) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->get_report_schedules: #{e}" end api_instance = AmzSpApi::ReportsApiModel::ReportsApi.new opts = { report_types: ['report_types_example'], # Array<String> | A list of report types used to filter reports. When reportTypes is provided, the other filter parameters (processingStatuses, marketplaceIds, createdSince, createdUntil) and pageSize may also be provided. Either reportTypes or nextToken is required. processing_statuses: ['processing_statuses_example'], # Array<String> | A list of processing statuses used to filter reports. marketplace_ids: ['marketplace_ids_example'], # Array<String> | A list of marketplace identifiers used to filter reports. The reports returned will match at least one of the marketplaces that you specify. page_size: 10, # Integer | The maximum number of reports to return in a single call. created_since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | The earliest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is 90 days ago. Reports are retained for a maximum of 90 days. created_until: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | The latest report creation date and time for reports to include in the response, in ISO 8601 date time format. The default is now. next_token: 'next_token_example' # String | A string token returned in the response to your previous request. nextToken is returned when the number of results exceeds the specified pageSize value. To get the next page of results, call the getReports operation and include this token as the only parameter. Specifying nextToken with any other parameters will cause the request to fail. } begin result = api_instance.get_reports(opts) p result rescue AmzSpApi::ReportsApiModel::ApiError => e puts "Exception when calling ReportsApi->get_reports: #{e}" end
Documentation for API Endpoints¶ ↑
All URIs are relative to https://sellingpartnerapi-na.amazon.com/
Class | Method | HTTP request | Description ———— | ————- | ————- | ————- AmzSpApi::ReportsApiModel::ReportsApi | {cancel_report} | DELETE /reports/2020-09-04/reports/{reportId} | AmzSpApi::ReportsApiModel::ReportsApi | {cancel_report_schedule} | DELETE /reports/2020-09-04/schedules/{reportScheduleId} | AmzSpApi::ReportsApiModel::ReportsApi | {create_report} | POST /reports/2020-09-04/reports | AmzSpApi::ReportsApiModel::ReportsApi | {create_report_schedule} | POST /reports/2020-09-04/schedules | AmzSpApi::ReportsApiModel::ReportsApi | {get_report} | GET /reports/2020-09-04/reports/{reportId} | AmzSpApi::ReportsApiModel::ReportsApi | {get_report_document} | GET /reports/2020-09-04/documents/{reportDocumentId} | AmzSpApi::ReportsApiModel::ReportsApi | {get_report_schedule} | GET /reports/2020-09-04/schedules/{reportScheduleId} | AmzSpApi::ReportsApiModel::ReportsApi | {get_report_schedules} | GET /reports/2020-09-04/schedules | AmzSpApi::ReportsApiModel::ReportsApi | {get_reports} | GET /reports/2020-09-04/reports |
Documentation for Models¶ ↑
Documentation for Authorization¶ ↑
All endpoints do not require authorization.