Shopify Shop details API works fine in Postman but not in the Rest API

bhavya_dev
New Member
2 0 0

Shopify get shop details api works fine in Postman, where I am passing the X-Shopify-Access-Token:  in the header and the Shopify API being:

This returns the shop details. 
 
When the same is being called from the rest api , it returns a status 200, but the response object is null. This is the request Id that I have tried most recently : 116ade23-69e2-4fa2-b03d-3c4a4b8ebad0 
 
And this is how the code looks like :
 
 

 

String shopApi = ShopifyConstants.shopRestApi.replace("#SHOPNAME",shop);
            HttpHeaders headers2 = new HttpHeaders();
            headers2.add(ShopifyConstants.httpAccessToken,accessToken);
            HttpEntity request2 = new HttpEntity(headers2);
            ResponseEntity<ShopifyShopResponse> respEntity = restTemplate.exchange(shopApi,HttpMethod.GET, request2, ShopifyShopResponse.class);
            LOGGER.info(respEntity.getBody().toString()+" "+respEntity.getStatusCode());

 

0 Likes