Hi,
I'd like to send a simple CSV file by API. Is it possible to build in Alteryx? Please, give an example.
Note: I sent the attached file via Postman.
Thanks,
Igor
This is specific on the API you are sending to.
1). csv is in the payload. API is expecting in your boy data in csv format. this is straight forward and your data stream is compiled via summarize tool into one field/one row - which goes into your download tool body.
2) .csv is file. you use block until done. you create your csv file via output data. you use blob input. you input your file you created. you use download tool and send your file in your api request.
3) you examine how you are doing this in postman by lookin gat code and seeing the curl. are you attaching it or is it in your payload? then you toggle to python requests. you replicate what you see there in python tool. you may still need the .csv file/blob from part 2.
try following my steps - and let me know where you hit an error.
I managed to do steps 1 and 2 but I couldn't do the last step. Please, see the screenshots below: What's happened?
how are you attaching your file in Postman? Can you check out the CURL code there to see any additional headers? Are you sending it as a .csv or a gzip? usually the length is calculated when sending. I'd look in that direction - you seem pretty close.For payload you probably need to add a content/type.
I attached the CSV file in the body sheet with the key = "files". Please, see the screenshot below: How can I attach the CSV file in the Download tool?
you skipped this step:
you use blob input. you input your file you created. you use download tool and send your file in your api request. You feed the blob field you created in blob input to your download tool as your body.
Your error now is that your url is not found (404) - this doesn' thave anything do with the blob attachments. Did you change your URL?