Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to send CSV file by API?

igorfv
8 - Asteroid

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

 

11 REPLIES 11
apathetichell
19 - Altair

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.

igorfv
8 - Asteroid

Hi, @apathetichell 

 

I appreciate your help. Could you send a sample, please?

 

Igor

apathetichell
19 - Altair

try following my steps - and let me know where you hit an error.

igorfv
8 - Asteroid

Hi @apathetichell 

 

I managed to do steps 1 and 2 but I couldn't do the last step. Please, see the screenshots below: What's happened?

 

Capturar1.JPGCapturar2.JPGCapturar3.JPGCapturar4.JPGCapturar5.JPG

 

 

 

apathetichell
19 - Altair

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.

igorfv
8 - Asteroid

Hi @apathetichell 

 

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?

 

 

Capturar7.JPG

apathetichell
19 - Altair

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.

igorfv
8 - Asteroid

@apathetichell  I tried but i can't. Could send a sample, please?

 

Capturar8.JPG

apathetichell
19 - Altair

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?

Labels