Bulk operation url

Solved
Highlighted
New Member
2 0 1

I'm new on shopify app.

I've performed a bulk operation and got back the jsonl file url from storage.googleapis. How can I download and parse data from the url programmatically?

Thanks

0 Likes
Highlighted
Shopify Expert
4186 29 410

This is an accepted solution.

You are given an URL. You can use any scripting language to open the file and parse it. As an example, in Ruby, it is this simple:

 

require 'open-uri'     # a library that allows you to open URL

download_url = "https://thecrazylongjsonurlwhereshopifyputallyourdata"
open(download_url) do |line|
    data_line = JSON.parse(line)      # so a line is a string, and JSON is a string, so we parse that string, and get back JSON, so we can programmatically deal with our data.
end

So note that in Javascript, Python or any other common scripting language, it is exactly the same! No difference. I use this pattern all over the place to bulk download data with the GraphQL API, then process it, and finally act on it. Things like massive inventory updates, or product transfers, tons of applications!

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
2 Likes
Highlighted
New Member
2 0 1

@HunkyBill Thanks so much for your support

1 Like