Skip to content

Submit API with CSV

Pradeeban Kathiravelu edited this page Jul 23, 2018 · 2 revisions

"Submit API: csv" ensures that the documents created with the CSV payload adhere to the provided header. The header should match the table attributes.

In MongoDB

Provide the CSV Column Header information in the form. As shown below in the screenshot below, this information is optional. If not specified the first line of the CSV file is assumed as the header.

Once the header is defined for the CSV, it is time to submit multiple documents to a Mongo collection using the "Try Me!!" option.

As can be seen from the screenshot, each mongo document takes a separate line. Each entry in a document is separated by a comma.

If the format of any of the documents in the csv does not match the header, an error similar to the below will be thrown: "{"errorDescription":"Execution of the Submit API failed","suggestedAction":"Check the input data","detailedMessage":"providerId=[edu.emory.cci.bindaas.datasource.provider.mongodb.MongoDBProvider] version=[1] : java.lang.ArrayIndexOutOfBoundsException: 2"}"

In MySQL and Postgres

The first line of the CSV file is assumed as the header. A sample CSV file is given below:

item, qty

table, 200

desk, 700

Note: Currently, only varchar attributes are supported in Bindaas Postgres provider, by default.

Clone this wiki locally