Creates a Location import. Either upload the file directly here (multipart/form-data, or JSON body with file_content as a Byte Array), or supply db_file_id for a file uploaded earlier via api/DbFile. Also accepts template_name (ASG-4066) to pick which template to use when more than one exists for this import_type - required only in that case.

Request Information

URI Parameters :

None.

Body Parameters :

db_import_create
NameDescriptionTypeAdditional information
file_content

The file content, as a Byte Array. Alternative to db_file_id - supply one or the other. Requires file_name to also be provided (the file name can't be inferred from the content)

Collection of byte
file_name

The file name, required when file_content is provided (ignored otherwise)

string
db_file_id

Foreign key to db_file containing the import data (id of a file uploaded earlier via api/DbFile). Alternative to file_content - supply one or the other

globally unique identifier
template_name

The exact name of the template to use for this import_type (ASG-4066). Required only when more than one template exists for this import_type - if exactly one template exists, it's used automatically and template_name can be omitted.

string

Request Formats :

application/json, text/json

Sample:
Option 1 - upload the file content inline (as a Byte Array / base64) in this JSON body, together with file_name (required - it can't be inferred from the content). This single call uploads the file and creates the db_import - no separate upload step needed (alternatively, see the multipart/form-data tab to send the file itself instead of base64):
{
  "file_content": "<base64-encoded file content>",
  "file_name": "stock-import.xlsx"
}

Option 2 - if you already have a db_file_id (e.g. from a file uploaded separately via api/DbFile), reference it here instead of resending the file:
{
  "db_file_id": "F086B579-2379-42AE-BFEF-01F6E2AD5F55"
}

template_name (ASG-4066) - add this to either option above to pick which template to use when more than one exists for this import_type. Omit it when only one template exists (it's used automatically); if omitted while several exist, or if the given name doesn't match any template, the request fails with an error:
{
  "db_file_id": "F086B579-2379-42AE-BFEF-01F6E2AD5F55",
  "template_name": "Default Stock Template"
}

multipart/form-data

Sample:
Send the file as the posted form file (multipart/form-data) - no JSON body needed in this mode. This single call uploads the file and creates the db_import automatically, no separate upload step needed (alternatively, see the application/json tab to upload the file content inline as base64, or to reference a db_file_id from a file already uploaded via api/DbFile). Add template_name as an additional form field to pick which template to use when more than one exists for this import_type (ASG-4066) - omit it when only one template exists.

Response Information

Resource Description :

IHttpActionResult with the created db_import id

db_import
NameDescriptionTypeAdditional information
id

Primary key

globally unique identifier

Required

uploaded_by_user_id

User who uploaded/created this import

globally unique identifier
date_creation

Date when import was created

date
date_creation

Date when import was created (XML/JSON serialization, "yyyy-MM-ddTHH:mm:ss.fffZ"). JSON uses this string property (rather than the raw date_creation above) because api/DbImport/... endpoints are plain (non-OData) routes: Json.NET's native DateTimeOffset serialization would otherwise write "+00:00" instead of "Z".

string
date_start_import

Date when import process started

date
date_start_import

Date when import process started (XML/JSON serialization, "yyyy-MM-ddTHH:mm:ss.fffZ"). JSON uses this string property (rather than the raw date_start_import above) because api/DbImport/... endpoints are plain (non-OData) routes: Json.NET's native DateTimeOffset serialization would otherwise write "+00:00" instead of "Z".

string
date_end_import

Date when import process completed

date
date_end_import

Date when import process completed (XML/JSON serialization, "yyyy-MM-ddTHH:mm:ss.fffZ"). JSON uses this string property (rather than the raw date_end_import above) because api/DbImport/... endpoints are plain (non-OData) routes: Json.NET's native DateTimeOffset serialization would otherwise write "+00:00" instead of "Z".

string
lines_total

Total number of lines in import file

integer
lines_imported

Number of lines successfully imported

integer
is_ready

Indicates if import is ready to be processed

boolean
is_locked

Indicates if import is locked (being processed)

boolean
is_done

Indicates if import is completed

boolean
remark

Additional remarks about the import

string

Max length: 4000

result

Result message of the import process

string
template_name

Name of the template used for this import (ASG-4066). On create, provide the exact name of the template to use when more than one template exists for the import_type; optional when only one template exists (it's used automatically). Maps to the underlying db_import.name column, but is exposed as template_name in the API.

string

Max length: 255

db_file_id

Foreign key to db_file containing the import data

globally unique identifier

Required

error_file_id

Foreign key to db_file containing error log

globally unique identifier
import_type

Type of import: COMPANY, CONTACT, ARTICLE, EQUIPMENT_MODEL, INSTALLATION, LOCATION, JOB, TASK, WORK_INSTRUCTION_DETAILS, PRODUCT_STOCK

string

Required

Max length: 100

import_error_count

Number of errors encountered during import

integer
is_template

Indicates if this is a template import configuration

boolean
percentage_done

Percentage of import completion (0-100)

integer
mapping

JSON mapping configuration for field mapping

string
options

JSON options configuration for import options

string
db_syncerp_log_id

Foreign key to db_syncerp_log if import is from ERP sync

globally unique identifier
modified_dateutc

Readonly system field managed by database, filled with GetUtcDate when adding, updating

date
modified_dateutc

Readonly system field managed by database, filled with GetUtcDate when adding, updating (XML/JSON serialization). JSON also uses this string property so non-OData endpoints (api/DbImport/Stock) output the same "yyyy-MM-ddTHH:mm:ss.fffZ" format as the OData endpoints.

string

Response Formats

application/json, text/json

Sample:

Sample not available.