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?
Solved! Go to the solution
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
If you want help, I can suggest a couple of things.
1. Tell the community what scripting language you are using
2. Show off some code. A few lines are all that is needed.
With that, you'll probably expose what you are doing wrong to someone in the community that recognizes what you are trying to do, and maybe they can help you. As you can tell, the URL is fine, and you get data. Now all you need to figure out is how to programmatically download an URL.
I created a separate post regarding this here: https://community.shopify.com/c/Shopify-APIs-SDKs/Shopify-Bulk-Operations-Issue/td-p/1134633 and will update it with the info you asked for. Please take a look at it there! Thanks!