I am trying to follow the API documentation to execute Aleryx Analytical App with File Browser tool to upload a file using i/user/v2/inputfiles/ endpoint.
https://help.alteryx.com/developer-help/gallery-api-inputfiles-endpoint
I uploaded a file using /user/v2/inputfiles/
and use the file reference Id as input question using /user/v2/workflows/{appId}/jobs/ but I keep getting following error.
The Action "Tool #25" has an error: The file "In_649bab54222e00004b005cdc\BodyPart_5fa5987b-71c1-4e42-826b-68052f1fe976" is not a known format. (2) (ToolId: -1)
If I run the same App from Gallery, I am able to pass (browse) the file and run it without any issue. I tried multiple tweaks to pass the file name with extension but it doesn't work.
I also tried "specifying_inputs_and_outputs.yxzp" from Alteryx tutorial https://community.alteryx.com/t5/Interactive-Lessons/Specifying-Inputs-and-Outputs/ta-p/243111 and its getting the same error.
Any help will be really appreciated.
Thanks
The payload looks like following.
{{url}}/user/v2/workflows/{{alteryx_workflow_id}}/jobs
You should use below API to post file to gallery and use the return string as file identifer when kick off.
POST /user/v2/inputfiles/ Publishes a file to be used in a workflow.
Implementation Notes
Use a MultiPart/Form-Data request to publish a temporary file to be used as an input to an Analytic App. The name of the required form-data section is inputFile.
Thank you Yougcan. Thats exactly I have done, as you can see the example below.
curl --location '<site>/webapi/user/v2/inputfiles/' \
--header 'Authorization: Bearer ...' \
--form 'inputFile=@"<inputfile.csv>
After uploading the file, I use the file reference Id into following call.
{url}}/user/v2/workflows/{{alteryx_workflow_id}}/jobs
Do you have any working example/workflow for this use case?
You code looks ok to me.
Based on error message the file id always converted to gallery version file path.
Hi,
Sorry for the late reply—this might still be useful to someone else. The error occurs because you’ve set the Action tool’s connected input tool to “Update Input Data Tool (Default)”. When you use the inputfiles API endpoint, that setting doesn’t populate all the fields the input tool needs to recognize and handle the file correctly (for example, file format, Excel sheet name, and so on).
If you’re using the inputfiles endpoint, switch the Action tool’s setting to “Update Value” on the connected input tool and explicitly define all the file properties beforehand. This ensures the input tool can import and process the file without errors.
When working with an Excel file, you’ll also need to adjust the file‐reference string up through the “.xlsx” extension—leaving intact any sheet specifier that follows. For example: "myData.xlsx|||Sheet1" you need to substitute only the substring "myData.xlsx"
This works if the sheet name is always the same. If you need the sheet name to be dynamic, unfortunately that endpoint still doesn’t let you specify it directly. In that case, you’ll have to resort to a workaround—either use a text box and perform a replace, or set the input tool’s “List of sheet names” property and select the desired sheet via a dynamic input.