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
612 stars 736 forks source link

Documentation Issue Java Connecting SP-API Using Java SDK sellingpartner-api-aa-java #60

Closed reynoldsdl closed 1 year ago

reynoldsdl commented 3 years ago

I have followed all the steps to generate SDK and .jar files. Particularly sellingpartnerapi-aa-java-1.0-jar-with-dependencies.jar . I have included the external jar into my project and stepping through the documentation "[Connecting to the Selling Partner API using a generated Java SDK" https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md#connecting-to-the-selling-partner-api-using-a-generated-java-sdk

Step 1: AWSAuthenticationCredentials awsAuthenticationCredentials=AWSAuthenticationCredentials.builder() .accessKeyId("myAccessKeyId") .secretKey("mySecretId") .region("us-east-1") .build();

Step 2: AWSAuthenticationCredentialsProvider awsAuthenticationCredentialsProvider=AWSAuthenticationCredentialsProvider.builder() .roleArn("myroleARN") .roleSessionName("myrolesessioname") .build();

Step 3: LWAAuthorizationCredentials lwaAuthorizationCredentials = LWAAuthorizationCredentials.builder() .clientId("myClientId") .clientSecret("myClientSecret") .refreshToken("Aztr|...") .endpoint("https://api.amazon.com/auth/o2/token") .build();

Step 4: SellersApi sellersApi = new SellersApi.Builder() .awsAuthenticationCredentials(awsAuthenticationCredentials) .lwaAuthorizationCredentials(lwaAuthorizationCredentials) .awsAuthenticationCredentialsProvider(awsAuthenticationCredentialsProvider) .endpoint("https://sellingpartnerapi-na.amazon.com") .build();

Issue is at step 4 The class SellersAPI has no method Builder so SellersApi.Builder() is unreslolved.

SpaceCondor commented 3 years ago

@reynoldsdl It is likely an issue with the Lombok library. The documentation doesn't mention it currently but it is necessary to configure Lombok properly in your IDE for the generated methods to work properly.

https://projectlombok.org/setup/overview

shrutigoel commented 3 years ago

I tried this. But still getting same issue. Please update.

SpaceCondor commented 3 years ago

@shrutigoel Did you configure Lombok? Which IDE are you using?

shrutigoel commented 3 years ago

@SpaceCondor yes , Lombok is configured. I am using Eclipse. Please find below information about Eclipse :

Eclipse IDE for Enterprise Java Developers (includes Incubating components)

Version: 2020-06 (4.16.0) Build id: 20200615-1200

(c) Copyright Eclipse contributors and others 2000, 2020. All rights reserved. Eclipse and the Eclipse logo are trademarks of the Eclipse Foundation, Inc., https://www.eclipse.org/. The Eclipse logo cannot be altered without Eclipses permission. Eclipse logos are provided for use under the Eclipse logo and trademark guidelines, https://www.eclipse.org/logotm/. Oracle and Java are trademarks or registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

This product includes software developed by other open source projects including the Apache Software Foundation, https://www.apache.org/.

Lombok v1.18.20 "Envious Ferret" is installed. https://projectlombok.org/

shrutigoel commented 3 years ago

Do we need to change sellersAPI .java ? I have added @Builder and @Data annotations in that and added lombok jar dependency.Do we need to do something else?

shrutigoel commented 3 years ago

can someone please update as I am stuck with this issue and not able to move forward.

ShivikaK commented 3 years ago

Hello @shrutigoel

Thank you for raising this issue.

We will need to work with you via a support case to resolve this issue. Please open a support case so we can pursue the investigation.

Thanks, Shivika Khare Selling Partner API Developer Support

shrutigoel commented 3 years ago

Can you please let me know how do I open a support case? Please share the url.

shrutigoel commented 3 years ago

@ShivikaK Is there any option to open the case without seller account? I raised the Case, but it was closed because seller account is deactivated. I have raised the case again to reactivate the account. Please let me know is there any other way?

scamar1982 commented 2 years ago

hi @shrutigoel, did you solve the issue? i have the same too and i can't to fix it. Thanks

rodrifed commented 1 year ago

Hi @shrutigoel,

In order to open a developer support case, you can use the Developer Portal's contact form: https://developer.amazonservices.com/support.

Thank you,

Federico Selling Partner Developer Services