Greetings, I have experienced a rather perplexing situation. I'm using Pipedream workflow steps to initiate Dropbox api calls, and they have been working perfectly. I have a Dropbox directory where I place some text files that I use as parameter files. I have successfully processed and downloaded one file from the directory in one of my workflows, but in another workflow, using the same calls as before but with a different filename, it returns "file not found". I even tried the same filename as before, and got the same results. I successfully executed the call to list files in the folder and the file exists, and I tried to use that reference to the file and still file not found.
Here's the code that I use in the first workflow (which works fine),
-------------------------------------------
async (events, steps, auths) => {
const fetch = require('isomorphic-fetch');
const { Dropbox } = require('dropbox');
const dbx = new Dropbox({
accessToken: auths.dropbox.oauth_access_token,
fetch
});
var filterFilesInResults = function (results) {
var filteredResults = [];
for (var k in results) {
if (results[k] && "file" == results[k].metadata[".tag"]){
filteredResults.push( results[k]);
}
}
return filteredResults;
};
this.filepath = params.file_path || ''
try {
this.resp = await dbx.filesSearch({
query: params.query,
path: this.filepath,
mode: params.search_mode,
});
var filtered = filterFilesInResults(this.resp.matches);
this.resp.matches = filtered;
} catch (err) {
this.err = err;
}
}
------------------------------------------
This works great and I'm able to process the information from the file.
However, when I implemented the same call in a different workflow, using the same code and changing the name of the file, the following error occurs.
steps.dropbox_find_file.filepath:/workflowapps_paramfiles/clickup_api_params.def
error:Error in call to API function "files/search": request body: missing required field 'query'
I'm using the same code as shown above, but simply changing the name of the file. And yet each time I execute the code, I get the response error shown above. Like I mentioned before I have tried listing the files in the folder, and I select the file from the list returned by the call to dropbox_list_folder, but the same error occurs.
What am I missing that triggers this error, when I haven't changed any of the code, but only the name of the file that I want to select?
Any input would be appreciated. Thanks.