cancel
Showing results for 
Search instead for 
Did you mean: 

anyway to send csv delimiter for prediction API via curl?

anyway to send csv delimiter for prediction API via curl?

Hi,

I need to send a csv file that uses the pipe "|" symbol as the field delimiter vs. a comma as input via predapi.   Due to env I am forced to use curl. I have found a "csvSettings" for the batch api but not in the predapi. I tried adding the parameter to the curl call but the delimiter does not seem to get set.  is there any way to pass or set this delimiter setting via api?

 

curl -i -X POST https://<url>/predApi/v1.0/deployments/<id>/predictions?passthroughColumnsSet=all
-H "Accept: text/csv" -H "Authorization: Bearer <api key>"
-F file=@"<input csv file>" -F "csv_settings={'delimiter':'|'}"

Labels (1)
0 Kudos
1 Reply

Hi @ed_garabedian

First off, apologies for the late reply!

We unfortunately do not support that parameter in the real-time prediction api. 

My suggestions would be to either rely on the batch prediction api (curl would work here as well) or attempt to parse and alter the data prior to calling the real-time api with a tool like `csvkit`, `csvtool` or `awk`.

0 Kudos