-
Notifications
You must be signed in to change notification settings - Fork 73
Description
I am trying to get an access token using exchange_temporary_token method but I don't get any error or any successful response.
I am implementing this node API in the AWS Lambda function.
var Shopify = new shopifyAPI({
shop: 'SHOP_NAME',
shopify_api_key: 'API_KEY', // Your API key
shopify_shared_secret: 'API_SHARED_SECRET'// Your Shared Secret
});
Shopify.exchange_temporary_token(event['queryStringParameters'], function (err, data){
if (err)
{
console.log(err);
}
else {
console.log(data);
}
console.log('Access token is..', data['access_token']);
});
I am using the correct shopify_api_key and shopify_shared_secret, but I can't see any error OR any data result OR access_token.
I can successfully call Shopify.is_valid_signature method and it is returning 'True' value.
Any suggestions for this on how I can get the details?
My 2nd question is:
I have also tried to call the below code, and the same issue (No errors, no data, no headers). I am calling this by setting my temporary token in the config
var Shopify = new shopifyAPI({
shop: 'SHOP_NAME',
shopify_api_key: 'API_KEY', // Your API key
shopify_shared_secret: 'API_SHARED_SECRET', // Your Shared Secret
access_token: event['queryStringParameters'].code
});
Shopify.get('admin/api/2022-07/shop.json', "", function(err, data, headers){
console.log(err);
console.log(data); // Data contains product json information
console.log(headers); // Headers returned from request
});
As per the docs the 2nd parameter query_params is optional so I haven't passed any.
Could you please suggest how I can get the shop details?
