I’m having an issue downloading my query results from a bulk mutation url:
https://shopify.dev/tutorials/perform-bulk-operations-with-admin-api#download-result-data
I can download the data when I access it from my browser, but when I try to do so from my private app I get the following error:
AccessDenied: Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.
I tried passing my access token when I made the GET request, but that still made no difference. Please lmk if you’ve encountered this and how you got around it!
Some more info:
I am using Rust, and simply running a cURL command from it. I used the same technique to run and poll the bulk query in the first place, and those worked fine; the url used in the function below is extracted from the polled result.
/// Gets query results from url and deserializes into struct
pub fn get_query_results(data: PolledResult, query_name: Option<&str>) -> Result<()> {
let url = data.url.unwrap(); --> String
let token = env::var("NTP_TOKEN")?;
// Send GET resuest using curl
let res = Command::new("sh")
.arg("-c") --> &mut Command
.arg(format!(
"curl -X GET {} \
-H 'X-Shopify-Access-Token: {}'
",
url, token,
))
.output()
.expect("cURL process failed to execute!");
// Get response string and clean it up
let res = String::from_utf8_lossy(&res.stdout).to_string();
let res = res.replacen("\\", "", res.len());
// DEBUG
println!("Query Results: {:?}", res);
Ok(())
}