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>"
}Create a backend import session by uploading a source file.
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>"
}Successful Response