Error with redash to googlesheets import function

Hi! I am getting all data from redash imported into googsheets directly through the API Key > Results in CSV format: using the IMPORTDATA function.

While it worked for the time - it has started error and never worked second iteration onwards. Throws the “Resource at url not found” error - snapshot below

image

Could an expert in this group help me navigate or in point where there is an issue and how to fix it ?

Thank you

Does the query use parameters by chance?

That’s correct! They they do have parameters

I see! You can’t use IMPORTDATA with queries that use parameters. Because the Redash API doesn’t allow you to GET results for parameterized queries. You need at least a POST request. IMPORTDATA only sends GET requests so they won’t work together.

It will work again if you remove the parameter from your query.

1 Like

@vikid @k4s1m Does anyone has some sample code for me to refer to? I bumped into the same problem, my query (developed by another Developer) has the parameter. I’m just a Finance User, could someone share the sample of POST request?
Thanks in advance

The documentation describes it pretty well: https://redash.io/help/user-guide/integrations-and-api/api

You post to api/queries/<query id>/results with a parameters object in your request body. The docs are written for a developer though so it might be outside the scope for a typical finance user.