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.