Git Product home page Git Product logo

jetsy's Introduction

JEtsy

A Java implementation of a Java version of the Etsy API

About

JEtsy (Java Etsy API) is 2 things:

  1. An API. JEtsy provides a Java version of the Etsy API. Etsy's REST API is fully described using java interfaces. This allows anyone to build their own implementation of that API and makes adapting or extending the implementation much easier to achieve.
  2. An Implementation. JEtsy provides a full implementation of the API mentioned above. This makes JEtsy usable right out of the gate. There's nothing to change, unless you need a specific feature or would rather use different underlying implementations (ex. a different Http transport).

Installation

Version 3.0.0014 of JEtsy is available from the Maven Central Repository here

<dependency>
    <groupId>com.notronix</groupId>
    <artifactId>JEtsy</artifactId>
    <version>3.0.0014</version>
</dependency>

Usage (TODO: update to V3 implementation with OAuth2.0)

JEtsy is intended to be used as a way to allow any Java developer to quickly get their own application (known as the "Client") off the ground and running. As a result, the first step required is to register your own application with Etsy. This registration process will provide you with a "key string" (known as the "App Key"). The App Key can then be used with JEtsy to make API calls. However, some API calls require you to obtain an access token which can also be obtained using JEtsy. The following steps illustrate how to get started.

  1. Register your application with Etsy here.

  2. Record the "key string" provided by completing step 1 above.

  3. Create an instance of EtsyAPI and AppKey using the key string from step 2.

    EtsyAPI etsyAPI = EtsyAPI.getDefaultInstance();
    AppKey appKey = AppKey.forKeyString("your_app_keystring");
    
    
    
  4. Use the etsyAPI to make API calls that do not require an access token.

    PingMethod<HttpContent> pingMethod = etsyAPI.getAuthResource().createPingMethod();
    Long pingResponse = etsyAPI.execute(appKey, pingMethod).getContent();
    
    
  5. To make API calls that require an access token, obtain your token using the OAuth flow.

    OAuthConnector connector = etsyAPI.getAuthResource().createOAuthConnector();
    String loginURL = connector.getConnectionURL(appKey, "redirect",
            Arrays.stream(EtsyScope.values()).collect(Collectors.toSet()));
    
    
    
  6. Visit Etsy via the login URL obtained in step 4 above. Etsy will require you to log in to an existing Etsy account. After a successful login, Etsy will ask you to grant your application (client) access to your account. If you specified an OOB callback then record the verifier code presented to you. If you specified your own callback URL, then Etsy will redirect to your URL and provide the verifier code as a query parameter.

  7. Use the EtsyDataService object and your verifier code to obtain access credentials. Access credentials will be required whenever the Etsy API indicates that OAuth is required. Details of the API methods are available here

    String verifier = "VerificationCodeProvidedByEtsy"; // replace this with your verification code
    Credentials accessCreds = etsyDataService.getAccessCredentials(temporaryCreds, verifier);
    
    
    
  8. Use the EtsyDataService and your credentials to make API calls to Etsy. The example below shows an API call to get the Etsy user associated with the account that was verified in step 5.

    List<String> userIdsOrNames = Collections.singletonList(EtsyAPI.__SELF__);
    List<EtsyUser> users = etsyDataService.getUser(accessCreds, userIdsOrNames, UserAssociations.values());
    EtsyUser authorizedEtsyAccountUser = users.get(0);
    
    
    

Contribution

  1. Found an issue? Add the details here
  2. Need a missing Etsy API method call added to this library? Add the details here
  3. Want code changed? Fork the repository and make a pull request.

jetsy's People

Contributors

cmunden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jetsy's Issues

An error occurred The requested redirect URL is not permitted.

Hi There.

Thanks for creating this great lib.

I was really making progress today, when I ran into
this problem while attemting to obtain an access token.

here is the URL
https://www.etsy.com/oauth/connect?response_type=code&client_id=rxn73x21e5i5vvs0wbqec032&redirect_uri=redirect&scope=address_r%20profile_r%20recommend_w%20listings_d%20shops_r%20cart_r%20shops_w%20cart_w%20address_w%20favorites_r%20transactions_w%20transactions_r%20recommend_r%20billing_r%20feedback_r%20profile_w%20email_r%20listings_r%20favorites_w%20listings_w&state=2ViOaL4I8IUplg&code_challenge=Used4Jezl37bzyw08GMN6vwPZQLBYUzbf20tepcVlGA&code_challenge_method=S256

However when I tried to use the above URL.

I receive:
An error occurred
The requested redirect URL is not permitted.

Any help is greatly appreciated

Kevin Citron
[email protected].

[ISSUE] getUser is not working

When i used getUser method. Can you help me solve this problem? Thank you.

Credentials accessCreds = etsyDataService.getAccessCredentials(temporaryCreds, oauth_verifier);
List userIdsOrNames = Collections.singletonList(EtsyAPI.SELF);
List users = etsyDataService.getUser(accessCreds, userIdsOrNames, UserAssociations.values());

Got exception

java.lang.NullPointerException: null at java.util.Objects.requireNonNull(Objects.java:203) at com.notronix.etsy.impl.method.GetUserMethod.requiresOAuth(GetUserMethod.java:28) at com.notronix.etsy.impl.method.AbstractEtsyMethod.<init>(AbstractEtsyMethod.java:39) at com.notronix.etsy.impl.method.GetUserMethod.<init>(GetUserMethod.java:23) at com.notronix.etsy.impl.EtsyDataService.getUser(EtsyDataService.java:143) at com.hst.podweb.web.rest.EtsyController.loginCallback(EtsyController.java:137) at com.hst.podweb.web.rest.EtsyController$$FastClassBySpringCGLIB$$a2b05804.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88) at com.hst.podweb.aop.logging.LoggingAspect.logAround(LoggingAspect.java:102) at sun.reflect.GeneratedMethodAccessor211.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691) at com.hst.podweb.web.rest.EtsyController$$EnhancerBySpringCGLIB$$d9a85bcf.loginCallback(<generated>) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:503) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:590) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:113) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:118) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:158) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:155) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at com.hst.podweb.security.jwt.JWTFilter.doFilter(JWTFilter.java:39) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:92) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:109) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

[ISSUE] updateVariationImages sent variation_images=null

v1.0.0012

Untitled

2020-11-13 11:39:45.737  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : -------------- REQUEST  --------------
POST https://openapi.etsy.com/v2/listings/903730831/variation-images
Accept-Encoding: gzip
Authorization: <Not Logged>
User-Agent: Google-HTTP-Java-Client/1.34.2 (gzip)
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 21

2020-11-13 11:39:45.737  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : curl -v --compressed -X POST -H 'Accept-Encoding: gzip' -H 'Authorization: <Not Logged>' -H 'User-Agent: Google-HTTP-Java-Client/1.34.2 (gzip)' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -d '@-' -- 'https://openapi.etsy.com/v2/listings/903730831/variation-images' << $$$
2020-11-13 11:39:45.806 DEBUG 8076 --- [eb-scheduling-1] jdk.event.security                       :  TLSHandshake: openapi.etsy.com:443, TLSv1.2, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, -114612200
2020-11-13 11:39:45.807 DEBUG 8076 --- [eb-scheduling-1] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@509c328d9 pairs: {POST /v2/listings/903730831/variation-images HTTP/1.1: null}{Accept-Encoding: gzip}{Authorization: OAuth oauth_consumer_key="h4apln887fo0e0c3nq18noxo", oauth_nonce="4ea0876dffcea0e", oauth_signature="pIg059plqUWHIj3Lly6cECfU4TQ%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1605267585", oauth_token="6da24e5597a09070ac1d8ae392cbf6"}{User-Agent: Google-HTTP-Java-Client/1.34.2 (gzip)}{Content-Type: application/x-www-form-urlencoded; charset=UTF-8}{Host: openapi.etsy.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}{Content-Length: 21}
2020-11-13 11:39:45.808  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : Total: 21 bytes
2020-11-13 11:39:45.808  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : variation_images=null
2020-11-13 11:39:46.045 DEBUG 8076 --- [eb-scheduling-1] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@7fdbb34d14 pairs: {null: HTTP/1.1 400 Bad Request}{Server: Apache}{X-CLOUD-TRACE-CONTEXT: ad3253f8634a0b0ab4740bd2d3564ac8/17368357534886447;o=0}{X-Etsy-Request-Uuid: Eu1Fk-Fgo4UImUDbxu-B-h9Ichac}{X-RateLimit-Limit: 10000}{X-RateLimit-Remaining: 9557}{X-Error-Detail: Value for variation_images was not a valid JSON string.}{Cache-Control: private}{Content-Length: 55}{Content-Type: text/plain;charset=UTF-8}{Date: Fri, 13 Nov 2020 11:39:46 GMT}{Connection: close}{Set-Cookie: uaid=20EZLo8lZ9BPYwv4_4v-pS7udsxjZACC-HUFTTC6Wqk0MTNFyUrJKSsw3djAO9M10KWqwMkovDDPyyfdxTHNr8woTamWAQA.; expires=Sat, 13-Nov-2021 11:39:46 GMT; Max-Age=31536000; path=/; domain=.etsy.com; secure; SameSite=None}{Set-Cookie: user_prefs=jcW0hUP4YD9dXGLUdpwPGry9DWhjZACC-HUFTTA6Oq80J0eHPCKWAQA.; expires=Sat, 13-Nov-2021 11:39:46 GMT; Max-Age=31536000; path=/; domain=.etsy.com}
2020-11-13 11:39:46.046  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : -------------- RESPONSE --------------
HTTP/1.1 400 Bad Request
Server: Apache
X-Error-Detail: Value for variation_images was not a valid JSON string.
Connection: close
X-Etsy-Request-Uuid: Eu1Fk-Fgo4UImUDbxu-B-h9Ichac
Date: Fri, 13 Nov 2020 11:39:46 GMT
X-RateLimit-Remaining: 9557
Cache-Control: private
Set-Cookie: user_prefs=jcW0hUP4YD9dXGLUdpwPGry9DWhjZACC-HUFTTA6Oq80J0eHPCKWAQA.; expires=Sat, 13-Nov-2021 11:39:46 GMT; Max-Age=31536000; path=/; domain=.etsy.com
Set-Cookie: uaid=20EZLo8lZ9BPYwv4_4v-pS7udsxjZACC-HUFTTC6Wqk0MTNFyUrJKSsw3djAO9M10KWqwMkovDDPyyfdxTHNr8woTamWAQA.; expires=Sat, 13-Nov-2021 11:39:46 GMT; Max-Age=31536000; path=/; domain=.etsy.com; secure; SameSite=None
X-RateLimit-Limit: 10000
Content-Length: 55
Content-Type: text/plain;charset=UTF-8
X-CLOUD-TRACE-CONTEXT: ad3253f8634a0b0ab4740bd2d3564ac8/17368357534886447;o=0

2020-11-13 11:39:46.047  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : Total: 55 bytes
2020-11-13 11:39:46.047  INFO 8076 --- [eb-scheduling-1] c.google.api.client.http.HttpTransport   : Value for variation_images was not a valid JSON string.
2020-11-13 11:39:46.048 ERROR 8076 --- [eb-scheduling-1] com.hst.podweb.web.rest.EtsyController   : Etsy request failed.

com.notronix.etsy.api.EtsyAPIException: Etsy request failed.
	at com.notronix.etsy.impl.EtsyDataService.execute(EtsyDataService.java:394)
	at com.notronix.etsy.impl.EtsyDataService.updateVariationImages(EtsyDataService.java:302)
	at com.hst.podweb.web.rest.EtsyController.lambda$uploadImageToListingVariants$1(EtsyController.java:396)
	at java.util.HashMap.forEach(HashMap.java:1289)
	at com.hst.podweb.web.rest.EtsyController.uploadImageToListingVariants(EtsyController.java:394)
	at com.hst.podweb.web.rest.EtsyController.updateVariantToListing(EtsyController.java:345)
	at com.hst.podweb.web.rest.EtsyController.uploadProductToEtsy(EtsyController.java:257)
	at com.hst.podweb.web.rest.EtsyController$$FastClassBySpringCGLIB$$a2b05804.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:771)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
	at com.hst.podweb.aop.logging.LoggingAspect.logAround(LoggingAspect.java:102)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)
	at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
	at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:95)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
	at com.hst.podweb.web.rest.EtsyController$$EnhancerBySpringCGLIB$$795fc376.uploadProductToEtsy(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
	at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.google.api.client.http.HttpResponseException: 400 Bad Request
Value for variation_images was not a valid JSON string.
	at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1113)
	at com.notronix.etsy.impl.EtsyDataService.execute(EtsyDataService.java:374)
	... 45 common frames omitted

Missing Javadoc and code examples make this library difficult to utilize

Needs Javadoc. Needs examples.

As a Java developer who also owns an Etsy shop, this library has taken quite a bit of effort and guesswork to get authentication credentials.

Once I got it to authenticate and store the creds, I found that there doesn't appear to be out-of-the-box support for calling getShop_Transaction, nor several other seller-related endpoints.

There are no tests to run to ensure that the default methods are working properly, yet the ones that I'm trying are returning 404's.

[FEATURE] Migrate to Etsy API v3

Is your feature request related to a problem? Please describe.
Etsy V2 API will expire end of this year and all calls will fail.

Describe the solution you'd like
Adapt JEtsy to new Etsy V3 API

[ISSUE] Personalisation missing?

First, thanks for sharing this library, looks like it has almost everything I was looking for.

Describe the bug
I have a listing that has customization for primary color, secondary color and personalisation.

My understanding is that the variations should have the those values, and indeed there are nodes for 3 values, but are null.

However, looking at etsyTransaction.getListingProduct().getPropertyValues(), I have found the primary color, secondary color values, but have not found the personalisation value.

FYI, I am asking for ShopAssociations.Receipts, ShopAssociations.Transactions, ShopAssociations.Listings, not sure if that has anything to do with it?

To Reproduce
Sample code here:
https://gist.github.com/gordonturner/d0b0333403aaa1daaa128294e827005f
https://gist.github.com/gordonturner/89ad05a8eb48c94fa75d0e66efe1a47a

It is a work in progress, so it is a little rough.

Expected behavior
The variations should have the primary color, secondary color and personalisation.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: MacOS
  • Browser N/A
  • Version: 1.0.0012

Smartphone (please complete the following information):
N/A

Additional context
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.