cancel
Showing results for 
Search instead for 
Did you mean: 

Sending CSV file from SFTP server to API (REST Post)

ricardoTyson
New Contributor II

Hi fellows, I am trying to send a csv file from an sftp server to an api endpoint but I can’t make the REST POST to work, I keep getting error:400 from the api
I have tried 3 different pipelines but all of them get the same error
I tried 3 different ways to pass it the input:
the fisrt one I format the file i get form the sftp and transform it to a document
image
input:
image
error:
image
POST setting:
image

then I tried just to read it and put it right away though the binary to document
image
input:
image
error:
image
POST settings:
image

then I tried to just write it(not in the pipline underneath) and read it from the local file store from snaplogic but didn’t work either
image

error:
image
POST settings:
image

Hopefully someone will spot what I’ve been doing wrong because I’ve spent a lot of time triyng to get this right :c
pd.I already tried guiding myself with these two posts I found with no success:

thank you in advance for reading.

9 REPLIES 9

Welcome @Fernando

Do you happen to have an error view set up for this Snap? You’ll be able to see the error_entity field message there to see if that gives you any additional details.


Diane Miller
Community Manager

robert_parks
New Contributor III

I ran into something simillar – we had a file we had to stage on a WEBDAV and it seems we should use a REST, but we were able to send the file to the API using the FileWriter with the account set up as Basic Authority.

thank you for taking the time to reply! although I don’t know if that could work for me as I have to use a token for security but it’s nothing I can’t try 😀

Fernando
New Contributor

“error_entity”:
“{“code”:400,“message”:“A CSV file must be provided in data field”}”

it looks like you’ve not specified the file that’s being uploaded in the “Single file upload: File” field, that’s 2 above the one you have blacked out.