Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

Inputfile format error using /user/v2/workflows/{{id}}/jobs API

bhaveshamin
5 - Atom

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

 

 

 

4 REPLIES 4
bhaveshamin
5 - Atom

The payload looks like following.

 

{{url}}/user/v2/workflows/{{alteryx_workflow_id}}/jobs

 

{
    "questions": [
        {
            "name""File Browse (24)",
            "value""649bab54222e00004b005cdc"
        }    ],
    "priority""High"
}
 
I think the key question is how Alteryx formats the input file ref. Id to In_649bab54222e00004b005cdc\BodyPart_5fa5987b-71c1-4e42-826b-68052f1fe976 and does it need more detail then just file ref. id, like filename and extension. Not sure how it generates the "BodyPart_" part of the file. The In_ part is based on the file ref. Id.
 
Any insight on how the input file ref. Id is being used by "/user/v2/workflows/{{id}}/jobs" wil be really helpful.
Yongcan
8 - Asteroid

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.

 

 

bhaveshamin
5 - Atom

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

{
    "questions": [
        {
            "name""File Browse (24)",
            "value""649bab54222e00004b005cdc"
        }    ],
    "priority""High"
}
 
And 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)

 

Do you have any working example/workflow for this use case?

 

 

 

Yongcan
8 - Asteroid

You code looks ok to me.

Based on error message the file id always converted to gallery version file path.

 

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)
 
Is your target workfow works fine with file type ( .csv file uploade?) or could you share your sample target workflow?