Hi All,
For one of my app, I am trying to access the authenticated shop
through cron jobs using gem shopify_api 3.0.0..
while getting the shop details, i am getting the following response
ActiveResource::Redirection: Failed. Response code = 302. Response
message = Found. =>
https://my-shop.myshopify.com/admin/shop.json
I am doing the steps
while login, i am storing the
token("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx") received
(request.env['omniauth.auth']['credentials']['token']) and the domian
of the shop ("
www.my-shop.com")
now in the cron job, i am using the shop domain and the token as
follows
* shopify_session = ShopifyAPI::Session.new(shop.domain, shop.token)
returns: #<ShopifyAPI::Session:0x000000036a7450 @url="www.my-
shop.com", @token="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">
* ShopifyAPI::Base.activate_session(shopify_session)
returns: {"User-Agent"=>"ShopifyAPI/3.0.0 ActiveResource/3.2.1 Ruby/
1.9.2", "X-Shopify-Access-Token"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
* shopify_shop = ShopifyAPI::Shop.current
returns: ActiveResource::Redirection: Failed. Response code = 302.
Response message = Found. =>
https://my-shop.myshopify.com/admin/shop.json
It should give me the shop details rather than redirecting me to a
json url.
Please let me know if i am missing something or doing something
wrong..
Thanks
Sumit Garg