⬇️Customer import schedule

You can add a related schedule by specifying an existing "customer import template". The schedule will import based on the specified time, file, and other information. To avoid data conflicts at the same time slot, if there are schedules with the same time, they will be executed according to the import execution order.

Create

POST https://{API_HOST}/api/v1/entity-import-task
curl -X POST
    '{"recipe_id":5,"has_header":0,"description":"test upload"}'
    -H "Content-Type: application/json"
    -F file=@/home/user/import.csv
    "https://{API_HOST}/api/v1/entity-import-task"

Request params

Parameter

Required

Default

Type

Description

recipe_id

true

NULL

Number

ID of the import template to use

has_header

false

false

Boolean

Whether to ignore the first row header

description

false

NULL

String

Schedule description

file

true

NULL

binary

Upload import file, maximum upload limit under 100MB, supports csv and xls formats.

Response

Property

Type

Description

data

Object

{
    "data": {
        "id": 2,
        "has_header": false,
        "file": "entity-import/1615362223-import.csv",
        "size": 50,
        "total_amount": 3,
        "description": "dddd",
        "status": 2,
        "current_sheet_index": 1,
        "current_row_index": 3,
        "job_turns": 1,
        "executed_start_at": "2021-03-10 15:43:44",
        "executed_end_at": "2021-03-10 15:43:44",
        "recipe_id": 1,
        "creater_id": 1,
        "created_at": "2021-03-10 15:43:43",
        "updated_at": "2021-03-10 15:43:44",
        "error": null,
        "restart_at": null,
        "stop_at": null,
        "recipe": {
            "id": 1,
            "name": "ccc",
            "description": null,
            "headers": [
                {
                    "value": "contacts.first_name"
                },
                {
                    "value": "contacts.membership_no",
                    "text": "Customer Number"
                },
                {
                    "value": "phone_numbers.number",
                    "set_id": 1
                },
                {
                    "value": "email_contacts.address",
                    "set_id": 1
                }
            ],
            "unique_columns": [
                "phone_numbers.number",
                "email_contacts.address"
            ],
            "creater_id": 1,
            "created_at": "2021-03-10T07:38:52.000000Z",
            "updated_at": "2021-05-19T12:18:49.000000Z",
            "importable_type": "App\\Contact"
        }
    }
}

List

Http Request

GET https://{API_HOST}/api/v1/entity-import-task

Parameter

Required

Default

Type

Description

page

false

1

Number

Which page currently

per_page

false

15

Number

How many items displayed per page

Response

Property

Type

Description

data

Array of objects

Import tasks

meta

Object

Tab object

View

Http Request

GET https://{API_HOST}/api/v1/entity-import-task/{id}

Response

Property

Type

Description

data

Object

Template list

You can find the matching template ID for the schedule via the API, or check related information through the system interface.

Http Request

GET https://{API_HOST}/api/v1/entity-import-recipe?importable_type=App\Contact

Query Parameters

Parameter

Required

Default

Type

Description

page

false

1

Number

Which page currently

per_page

false

15

Number

How many items displayed per page

importable_type

true

null

String

Template type, here please provide App\\Contact

Response

Template view

Http Request

GET https://{API_HOST}/api/v1/entity-import-recipe/{id}

URL Parameters

Parameter

Description

id

Batch import template ID

Response

Last updated