Skip to main content
POST
/
v2
/
imports
/
sessions
Create Import Session
const form = new FormData();
form.append('template_id', '<string>');
form.append('upload_file', '<string>');
form.append('numeric_locale', '<string>');
form.append('project_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('folder_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');
form.append('raw_file_id', '3c90c3cc-0d44-4b50-8888-8dd25736052a');

const options = {
  method: 'POST',
  headers: {'x-organization-id': '<x-organization-id>', 'x-api-key': '<api-key>'}
};

options.body = form;

fetch('https://api.dcycle.io/v2/imports/sessions', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "import_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "file_name": "<string>",
  "total_rows": 123,
  "detected_header_row": 123,
  "source_columns": [
    "<string>"
  ],
  "sample_rows": [
    [
      "<unknown>"
    ]
  ],
  "numeric_locale": "<string>",
  "sheets": [
    "<string>"
  ],
  "selected_sheet": "<string>"
}

Authorizations

x-api-key
string
header
required

Headers

x-user-id
string<uuid>
x-api-key
string
x-organization-id
string<uuid>
required

Body

multipart/form-data
template_id
string
required
upload_file
file
required
numeric_locale
string
project_id
string<uuid>
folder_id
string<uuid>
raw_file_id
string<uuid>

Response

Successful Response

Response returned after parsing an uploaded file.

import_id
string<uuid>
required
file_name
string
required
total_rows
integer
required
detected_header_row
integer
required
source_columns
string[]
required
sample_rows
any[][]
required
numeric_locale
string
sheets
string[]
selected_sheet
string