# Exposing .csv via Wolfram Cloud API

I'm sure there's a better way to accomplish this, but my goal is to generate a .csv file from a running notebook, and have it accessible by API.

In the main program, I'm exporting the data like so:

CloudExport[csvTable,"CSV","outputFile.csv"];


From there, I'm able to access it and expose it using

CloudDeploy[APIFunction[{}, StringForm[CloudImport["outputFile.csv","Text"]]],Permissions->"Public"]


When I do a CloudImport in a notebook (as text), the data looks correct. But when I open it in the API, it is quoted and appended with [<||>]

Is there a better way to do this? How can I prevent the additional characters from being added? In the end I just want an external consumer to access and process the data.

thanks!

• also, I can't CloudImport as "CSV" because the output will just be a Mathematica Array. – Rick R Nov 3 '14 at 5:58
• Well, it doesn't exactly solve the problem, but it helps with my problem. I think I can skip the additional API step by doing CloudExport[csvTable,"CSV","outputFile.csv",Permissions->"Public"]; – Rick R Nov 3 '14 at 6:47