RESTful API - using POST to upload a file
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello all -
Has anyone been able to successfully utilize the download tool to upload a file to a RESTful API?
I've been able to POST to an FTP/SFTP, but I cannot seem to figure out how to make this POST command works.
Here's the 30,000ft view of how the API I am connecting to works:
- POST a file of names and address
- Utilize GET commands to perform various actions on the file/download results.
I have been able to set everything for the GET commands and return data successfully within both Alteryx and POSTMAN. However, I have only been able to execute the POST/upload in POSTMAN.
I've attempted converting the CSV file to a Blob and including/not including it in the Payload, but get the same error message.
In Alteryx I simply get an error returned: {"success":false,"message":"ERROR·Submitted·file·path·does·NOT·exists"}¶
Anyone have successful examples I can look at?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I struggled for a little while to upload a document (trying to avoid using the command line). For me the key to getting this to work was using the blob input tool followed immediately by a blob convert to change the blob field to a base64 encoded string.
After that it was just configuring the download tool to work correctly with the API I was attempting to use. I don't have any sample code to share, but I have a screen shot of the macro I created to encapsulate the upload process. I don't have any formal training so the JSON creation piece is probably ugly, but it works for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is it possible to share some screenshots of the tools configuration i.e. Configuration of Blob tools and the final API tool
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
hope this helps
  
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
As someone who works at a company that (logically, I might add) blocks the use of .bat files on local machines, is there no other way that this can be performed? I feel like this should be a tool in the arsenal since uploading files via an API is a fairly common and routine operation that a program like Alteryx would use. thanks @TashaA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Can you please also share the download tool configuration screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
here you go!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you very much for the screenshots.
I see in this case the Content-Type is application/json
However I am working with Content-Type: multipart/form-data.
When trying to configure I encountered below issues:
1) If I try to send data as multipart/form-data, the API gives an error 'No boundary Value Set'. It seems like Alteryx does not do this automatically.
2) To solve the above issue I explicitly set Content-Type to multipart/form-data; boundary=----MyBoundary. This solved the boundary error, but started giving the error stating: The required part 'file' is not present.
3) To solved the above I explicitly constructed the body and passed it to the Download tool: The Body is as follows:
'
------MyBoundary
Content-Disposition: form-data; name="file"; filename="rakTestAlteryx.csv"
Content-Type: multipart/form-data
'
+
Test Data
+
'
------MyBoundary--
This resolved the the part of present issue. However then I started getting stream unexpectedly closed error.
Post this I have hit a deadend.
Has anyone ever succeeded in uploading a multipart content via Download tool?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @mutama , @AlteryxAdvocacy This is an urgent issue. Can you please ask support team to look into this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I have already raised the exact same issue with all the screenshots here:
I have tried a lot of combination over the download tool but ended up using the Python Script i have created in the above discussion.
As far as I understand the Alteryx Download tool is able to support Posting form Data only or Posting a file only however, Posting File+Data is not feasible with the Download Tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
In my case I am just trying to upload file using REST API