require "shopify_api"
access_token = "shpat"
shop = "test.myshopify.com"
session = ShopifyAPI::Auth::Session.new(
shop: shop,
access_token:
)
# use admin rest client to specify api version
rest_client = ShopifyAPI::Clients::Rest::Admin.new(session: session, api_version: "2024-01")
response = rest_client.get(path: "products")
p response
# use ShopifyApi::Context to specify api version
ShopifyAPI::Context.setup(
api_key: "<api-key>",
api_secret_key: "<api-secret-key>",
scope: "read_orders,read_products,etc",
is_embedded: true, # Set to true if you are building an embedded app
api_version: "2024-01", # The version of the API you would like to use
is_private: false, # Set to true if you have an existing private app
)
products = ShopifyAPI::Product.find_all
p products
Checklist:
[x] My commit message follow the pattern described in here
[x] I have performed a self-review of my own code.
[ ] I have added tests that prove my fix is effective or that my feature works.
Description
Fixes https://github.com/Shopify/shopify-api-ruby/issues/1329
How has this been tested?
Script for graphql admin client with api version
Script for REST
Checklist: