amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
585 stars 730 forks source link

C# Full End-to-End Example - Where can I find it? #1235

Closed nrogers805 closed 2 years ago

nrogers805 commented 3 years ago

Not sure if I am missing something or the documentation is lacking information.

I cannot find a simple example of a c# application that gets the user authorisation and then uses any of the api's to get market info, such as a list of orders. Is there such an example?

For instance the Orders api readme states :

public void main() {

        var apiInstance = new OrdersVApi();
        var orderId = orderId_example;  // string | An Amazon-defined order identifier, in 3-7-7 format.

        try
        {
            GetOrderResponse result = apiInstance.GetOrder(orderId);
            Debug.WriteLine(result);
        }
        catch (Exception e)
        {
            Debug.Print("Exception when calling OrdersVApi.GetOrder: " + e.Message );
        }
    }

bur nowhere is it showing how to integrate the user credentials before calling the api

In fact this api example does not even add the required header as defined here:

Name | Description

host | The marketplace endpoint. See Selling Partner API HTTP methods. x-amz-access-token | The LWA access token. See Step 1. Request a Login with Amazon access token.Note about restricted operations. If you are calling a restricted operation, pass in a Restricted Data Token (RDT) here instead of an LWA access token. For information about getting RDTs and calling restricted operations, see the Tutorial: Get an RDT and call restricted operations in the Tokens API Use Case Guide. x-amz-date | The date and time of your request. user-agent | Your application name and version number, platform, and programming language. These help Amazon diagnose and fix problems you might encounter with the service. See Include a User-Agent header in all requests.

What am I missing?

nrogers805 commented 3 years ago

Hi @rugved1991

Could we have an answer to this please?

I am not the only one asking this

Thanks

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.