Developer Docs

Documentation to integrate EasyCSV with your application or Zapier.

How to create an import form

Step 1: Click the "New Sheet" button

After loggin in you will be brought to your list of spreadsheet imports. Click the "New Sheet" button.

Step 2: Configure spreadsheet import

Specify all required fields.

Pro Tip:
You do NOT have to specify an API/Webhook endpoint URL for testing the form. It can be added later when your application is ready to start accepting imports.

Step 3: Specify required and optional columns for spreadsheets being imported

In the navigation above the spreadsheet form click on "Columns & Rules".

Add any new column rules you want. You can specify if they are required. You can also choose the required data format.

When a user attempts to import a spreadsheet, EasyCSV will validate every field has the right data format and tell the user if there are any errors they need to resolve in order to finish the import.

How to process the data in your API/Application/Webhook

Step 1: Create a public API/Webhook endpoint and specify in the spreadsheet import settings

Create a public endpoint that accepts a POST of either JSON (default & preferred) or Form params data (can be chosen in the spreadsheet import form settings).

Log in and go to your speadsheet import form. In the top nav click "Sheet Details".

Click the checkbox to "Post imports to Webhook". Then type or paste the URL of your public API/Webhook endpoint.

Step 2: Handle the incoming request from EasyCSV

Your endpoint should accept the incoming data. Validate the data is correct and safe to save. The data will come in as one http POST per row/record of the spreadsheet being imported.

Here is some example JSON that could be sent to your API/Webhook for each record:

{
  "import_id": 12345,
  "import_name": "product_list.csv",
  "importer_email": "example@yourdomain.com",
  "sheet_name": "Ecommerce Product Listings",
  "sheet_slug": "product",
  "sheet_id": 67890,
  "import_code": "gft6353ruy7",
  "record_data": {
    "product_name": "Widget",
    "product_description": "Change channels on your TV.",
    "price_in_cents": 1000,
    "homepage": "https://www.widget.com?utm_source=amazon"
  },
  "virtual_fields": {
    "website_root_domain": "widget.com"
  }
}

Keys that will be present on every request for every record/row:

  • import_id
  • import_name
  • importer_email
  • sheet_name
  • sheet_slug
  • sheet_id
  • import_code (this is most likely going to be null. Read more here.)
  • record_data
  • virtual_fields (empty unless virtual output fields are configured)

Values that can CHANGE on every request:

  • Keys & values nested under record_data & virtual_fields will be unique per record/row of the spreadsheet being imported. Spreadsheet column titles are the keys for record_data.

Pro Tip #1:
You may want to write your code to not allow duplicate records/rows to be imported IF your system needs things to be unique. If your system allows many objects with the same content, then simply process and save each incoming record/row.

Pro Tip #2:
You may want to save the import_id or other info on any records you create in case you want to delete or fix data from a specific import.

Pro Tip #3:
You may have a use case where you want to save things imported as a "draft" needing approval from an admin.

How to send a test row to your webhook

Step 1: Add your API webhook URL to your sheet

If you have not already specified a public API webhook URL for your spreadsheet then click edit on the sheet and add one.

Step 2: Click the 'Send Test Row' button.

If you are logged in as an admin, view the spreadsheet import form. You will notice a 'Send Test Row' button in the right side column. Simply click it!

Failing a record/row instead of importing it to your application

If you need to fail a record you should return a proper error code in the 400 or 500 range with a response body giving the reason. All failed records will be shown to the user with the reason (response body you return to EasyCSV) why they failed so the user can try to fix the problematic records and re-import them.

How to limit access for spreadsheet import - 4 options

Simple Password

Specify a simple password a user has to enter to see the spreadsheet upload form.

Require Google Account login to import

Users will be required to sign-in with their Google Account before importing spreadsheets.

Require that a user's email address is for a specific domain

Requiring Google Account sign-in first is a pre-requisite for whitelisting email domains. After specifying a list of acceptable email domains, if the user's Google Account email address is not for an email domain in your whitelist then they will not be allowed to import spreadsheets.

Trade unique tokens with your app for trusted uploads

Step 1: Create any string to add as an import code when a user wants to make an import into your application. Either generate the import code in a unique way only your system knows is real or save the import code to lookup it's validity later.

Step 2: Force your user to click on a link to go to your easycsv.io spreadsheet upload form. Append the unique token/code to the url with "?import_code=12345example". Full example: https://www.easycsv.io/company_slug/sheet_slug?import_code=12345. This code will flow back to your app when your users does an import.

Step 3: In your API/Webhook look for the "import_code". Fail any imports that do not have an "import_code" or if they have an "import_code" your system doesn't recognize.

How to I take part of a value or combine values from the importing spreadhseet?

We recommend you do this with our Virtual Output Fields solution.

Step 1: Have an admin navigate to the Sheet import page.

Click the "Virtual Output Fields" link in the top navigation.

Step 2: Create a new Virtual Output Field Rule

Select up to 5 spreadsheet columns you would like to combine when importing.

When selecting each column you can perform some common actions on the data being imported. Examples: Captialize, Extra things from URLs, Count characters, and many more...

Step 3: Update your app to check for Virtual Fields

Use the "virtual_fields" part of the JSON being posted to your endpoint to import this extracted and transformed data.

You can also do this with Zapier. Setup an account on Zapier.com and then use the EasyCSV action to extract, transform, combine any values being imported and forward the result on to your API webhook or any other destination application/API Zapier supports. Read our special page about how to use EasyCSV & Zapier together.

How to setup Zapier + EasyCSV

Read our special page about how to use EasyCSV & Zapier together.

How to setup Slack + EasyCSV

Step 1: Get Webhook URL for your Slack workspace

Go here and follow directions under the 'Setup Incoming Webhooks' section: Get webhook for Slack workspace

Step 2: Copy & Paste webhook URL in EasyCSV

Copy your webhook URL from Slack. It will look like this: https://hooks.slack.com/services/12345/abcde/easy123789

Login and click on "Business Info" in the top nav dropdown menu. Access if by clicking on your name in the upper right corner after logging in.

Paste your webhook URL in the "Slack Webhook URL" field.

Click save and you will start seeing info about imports being saved in the Slack Channel you specified for the webhook.