Search code examples
restsocratasoda

Upload a document to Socrata using REST API


I am attempting to upload a file to a socrata site using their REST API. The file(s) I am trying to upload can be access directly by my application and could be serialized, or I could point Socrata to a url. The rest of the datatypes I am using are pretty straight forward; strings, dates, ect. But I can't seem to find any documentation on how to upload a file using REST with Socrata.

Is it even possible?

Thanks in advance.


Solution

  • There's no "official" way of uploading files to Socrata, hence no documentation. If you want to attach a file to the dataset programmatically, then what existing libraries (Java in this example) do is use the /api/assets endpoint (which, if I'm not mistaken, is what the UI uses for uploading documents) and do a multipart POST.