Alteryx Server Discussions

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

user/v2/inputfiles - workflow examples

CodyPedersen
6 - Meteoroid

Hey all, I'm looking to see if anyone has example analytic apps for using a file reference ID as described in Gallery API: Inputfiles Endpoint. As someone who is not very familiar with how these temporary files are stored on alteryx servers, anything would be helpful. I've tried a few variations and for each I receive a file not found error. 

 

Any example workflows, input or direction as to where to look is appreciated.

 

Thank you

13 REPLIES 13
clarab
Alteryx
Alteryx

Hi @CodyPedersen 

 

Assuming you have an analytic app with a File Browse tool, to upload a file into this tool, you will need to use the /user/v2/inputfiles endpoint. This endpoint will return you the reference Id, which you can use in the /user/v2/workflows/{appId}/jobs to submit the job.

 

You may want to review this https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/How-to-Pass-in-Excel-Worksheet-Name-i... and use it as an example.

Hi,

 

Yue mentioned that we have to use the /user/v2/inputfiles endpoint. But i couldn't find any reference on how to use this endpoint.

 

 

I get this response:

{ "data": null, "exceptionName": "UnknownException", "innerExceptionMessage": "", "message": "Unknown error.\nInvalidOperationException\nRequestID: 29dc6e4f30334eaba707332d2e8efbb6" }

 

What exactly the body structure for the call?

 

AbdulazizAljandal_0-1628421421957.png

 

 

Thank you.

 

 

clarab
Alteryx
Alteryx

@Abdulaziz-Aljandal Please use Postman or curl command for this endpoint. The interactive document is not able to post form data.

avanibhatnagar
8 - Asteroid

@CodyPedersen @Abdulaziz-Aljandal  - Were you ever able to successfully use the InputFiles Endpoint using the Gallery API. I have a javascript application where I'm embedding my analytic app. Everything works except the File Browse tool, and I'm trying to figure out how to make it work. Any suggestions are appreciated! 

cgoodman3
14 - Magnetar
14 - Magnetar

@clarab do you have an example of how to make this request in postman? I have the following but I get an authorisation error.

cgoodman3_0-1630692848845.png

 

Alternatively is it possible to use the download tool in Alteryx to publish the file?

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com

@avanibhatnagar  - Actually I used a workaround for now (I have been using this before the new API user/v2/inputfiles came).

The workaround is simple instead of taking the file via Browse tool. Just write the data to a table in the database and then take the parameters from an API call to query the database to get the "Uploaded data".

 

So, whenever a user uploads a file the data in the file goes to a database and then trigger the workflow with the required parameters to get the uploaded data.

clarab
Alteryx
Alteryx

@cgoodman3 The authorization should look like this:

 

clarab_1-1630927642698.png

 

 

The API key and secret are taken from My Profile > Keys. The user must have "Enable API" option set to Yes.

 

cgoodman3
14 - Magnetar
14 - Magnetar

Thanks @clarab I've got it working when using the full API credentials, it doesn't work using the subscription (private studio) api credentials.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
cgoodman3
14 - Magnetar
14 - Magnetar

Just to follow up. I get the following error message when retrieving the job status.

 

cgoodman3_0-1632301360573.png

The upload file is a .xlsx with only two columns and contains Sheet1 so I use the JSON body as suggested in this post - https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/How-to-Pass-in-Excel-Worksheet-Name-i...

 

Could you provide help on this?

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com